<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">تقرير بضاعة اول مدة </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 wdt300">المنتج</label>
                        <input type="hidden" class="select2product wdt300"  name="productId" id="productId" data-placeholder="اختر منتج"  />
                    </div>
                    <div class="form-group">
                        <label class="sr-only">تصنيف المنتج</label>
                        <select class="select2 wdt300"  name="productCatId" id="productCatId" >
                            <option value="-1">اختر تصنيف</option>



                            {*foreach $productCatData as $cat*}



                            <!--          <option value="{$cat->productCatId}">{$cat->productCatName}</option>
                            -->
                            {*/foreach*}
                            {for $j=0 to $itr}




                            <option value="{$parentId{$j}}">{$names{$j}}</option>





                            {/for}



                        </select>
                    </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>


                    <div class="form-group">
                        <label class="sr-only">الترتيب</label>
                        <select class="select2 wdt300"  name="order" id="order" >



                            <option value="desc">تصاعدى</option>
                            <option value="asc">تنازلى</option>






                        </select>
                    </div>
                    <br />


                    <div class="form-group">
                        <label class="sr-only">الاسعار  : </label>

                        <input name="productBuyPrice" type="checkbox" value="1" /> سعر الشراء
                        <input name="productSellAllPrice" type="checkbox" value="1" /> جمله

                        <input name="productSellHalfPrice" type="checkbox" value="1" /> نصف جمله

                        <input name="productSellUnitPrice" type="checkbox" value="1" /> تجزئة
                    </div>
                    <br />
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            {if {count($storedetailData)} > 0}
            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading">{$message}</div>
                <div class="panel-body">
                    <hr/>
                    {if {count($storedetailData)} > 0}
                    <!--div class="col-lg-offset-8 col-lg-4">
                      <div class="well well-sm">
                        <h4 class="text-center">اجمالى سعر المنتجات {$sumValue} {$currency}</h4>
                      </div>
                    </div-->
                    {/if}
                    <table class="table table-black">
                        <thead>
                            <tr>
                                <th>الرقم</th>
                                <th>اسم المخزن</th>
                                <th>اسم المنتج</th>
                                <th>الكمية</th>
                                {if {$productBuyPrice} eq 1}
                                <th>سعر الشراء</th>
                                {/if}

                                {if {$productSellAllPrice} eq 1}
                                <th>سعر الجمله</th>
                                {/if}

                                {if {$productSellHalfPrice} eq 1}
                                <th>سعر نصف لجمله</th>
                                {/if}
                                {if {$productSellUnitPrice} eq 1}
                                <th>سعر الوحدة</th>
                                {/if}
                                <th>تاريخ اخر عملية</th>
                            </tr>
                        </thead>
                        <tbody>
                            {assign var=x value=1}
                            {foreach $storedetailData as $storedetail}
                            <tr>
                                <td>{$x}</td>
                                <td>{$storedetail->storeName}</td>
                                <td>{$storedetail->productName}</td>
                                <td>{$storedetail->productquantity}</td>
                                {if {$productBuyPrice} eq 1}
                                <td>{$storedetail->productBuyPrice}</td>
                                {/if}

                                {if {$productSellAllPrice} eq 1}
                                <td>{$storedetail->productSellAllPrice}</td>
                                {/if}

                                {if {$productSellHalfPrice} eq 1}
                                <td>{$storedetail->productSellHalfPrice}</td>
                                {/if}
                                {if {$productSellUnitPrice} eq 1}
                                <td>{$storedetail->productSellUnitPrice}</td>
                                {/if}
                                <td>{$storedetail->storedetaildate}</td>
                            </tr>
                            {capture assign=x}{$x+1}{/capture}
                            {/foreach}

                        </tbody>

                    </table>
                    <!--div class="col-lg-offset-8 col-lg-4">
                      <div class="well well-sm">
                        <h4 class="text-center">اجمالى سعر المنتجات {$sumValue} {$currency}</h4>
                      </div>
                    </div-->
                    {/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>
