<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
</style>

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">التقارير</a></li>
            <li class="active">تقرير كارت الصنف</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">تقرير كارت الصنف
                <a href="{$youtubes[73]->url}" target="_blank" class="hidden-print"><img
                        src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube"
                        style="width: 2%;"></a>
            </div>
            <div class="panel-body">
                <form class="form-inline hidden-print" action="productcardController.php?do=show" method="post">
                    <input type="hidden" name="searchvalue" id="searchvalue"
                        value="{$Programsettingdata->searchvalue}" />
                    <div class="form-group">

                        <label class="sr-only" style="width:40px">المنتج</label>
                        <input type="hidden" class="select2product wdt300" name="productId" id="productId"
                            data-placeholder="اختر منتج" />
                    </div>

                    <br />

                    <div class="form-group">
                        <label class="sr-only">المخزن</label>
                        <select class="select2 wdt300" name="storeId" id="storeId">
                            <option value="-1">اختر مخزن</option>



                            {foreach $storeData as $store}




                            <option value="{$store->storeId}">{$store->storeName}</option>


                            {/foreach}



                        </select>
                    </div>

                    <br />
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"
                            data-date-format="yyyy-mm-dd" name="from">
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"
                            data-date-format="yyyy-mm-dd" name="to">
                    </div>

                    <br />


                    {if $Usergroupdata->hideBillPrices !=1}
                    <div class="form-group">
                        <label class="sr-only">نوع السعر</label>&nbsp;&nbsp;
                        <input name="productBuyPrice" type="checkbox" value="1" />&nbsp;
                        <label>شراء</label>
                        &nbsp;&nbsp;
                        <input name="productSellUnitPrice" type="checkbox" value="1" />&nbsp;<label>بيع</label>
                        &nbsp;&nbsp;

                        <input name="productSellAllPrice" type="checkbox"
                            value="1" />&nbsp;<label>جمله</label>&nbsp;&nbsp;
                        <input name="productSellHalfPrice" type="checkbox" value="1" />&nbsp;<label>نصف
                            جمله</label>&nbsp;&nbsp;
                    </div>
                    <br />
                    {/if}
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            {if {count($storedetailData)} > 0}
            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading">
                    <table class="table table-black">
                        <thead>
                            <tr>
                                <th>معلومات عن المنتج</th>
                                <th>رصيد اول مدة</th>
                                <th>الكمية الحالية</th>
                                <th>مجموع كل المنصرف</th>
                                <th>مجموع كل الوارد</th>
                            </tr>
                        </thead>

                        <tbody>
                            <tr>
                                <th>{$message}</th>
                                <th>{$quantityOfFirstPeriod->productbefore}</th>
                                <th>{$productquantity}</th>
                                <th>{$totalStoreReportTypeOneData->productquantity}</th>
                                <th>{$totalStoreReportTypeZeroData->productquantity}</th>
                            </tr>
                        </tbody>

                    </table>

                </div>
                <div class="panel-body">
                    <hr />
                    {if {count($storedetailData)} > 0}

                    {/if}
                    <table class="table table-black">
                        <thead>
                            <tr>
                                <th>الرقم</th>
                                <th>التاريخ</th>
                                <th>البيان</th>
                                <th>المخزن</th>
                                <th>رصيد</th>
                                <th>الوارد</th>
                                <th>المنصرف</th>
                                <!--th>الملاحظات</th-->
                            </tr>
                        </thead>
                        <tbody>
                            {assign var=x value=1}
                            {foreach $storedetailData as $storedetail}
                            <tr>
                                <td>{$x}</td>
                                <td>{$storedetail->storereportdate}</td>
                                <td>{if $storedetail->link != ''} <a href="{$storedetail->link}" target="_blank">{$storedetail->processname}</a>{else}{$storedetail->processname}{/if}
                                </td>




                                <td>
                                    {foreach $storeData as $store}
                                    {if $store->storeId eq $storedetail->storeid}
                                    {$store->storeName}
                                    {/if}
                                    {/foreach}
                                </td>


                                <td>{$storedetail->productbefore}</td>
                                <td>
                                    {if {$storedetail->storereporttype} eq 0}
                                    {$storedetail->productquantity}
                                    {/if}</td>
                                <td>
                                    {if {$storedetail->storereporttype} eq 1}
                                    {$storedetail->productquantity}
                                    {/if}
                                </td>

                            </tr>
                            {capture assign=x}{$x+1}{/capture}
                            {/foreach}

                        </tbody>

                    </table>

                    {/if}
                    <div class="clearfix"></div>
                    <hr />
                    {if {count($storedetailData)} > 0}
                    <div class="noprint">
                        <div class="col-lg-12">
                            <div class="form-group">
                                <div class="col-lg-4">
                                    <button type="button" onclick="print_Custom('mycustomheader');"
                                        class="btn btn-success pull-right hidden-print">طباعة</button>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    {/if}
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>