<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
    @media print {
        p,h4,h3,h2,h1,span,label,td,th,div.dataTables_info,a,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
        div.dataTables_wrapper div.dataTables_info, tr.odd td.sorting_1{
            color:#000!important
        }
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{
            text-align: center!important
        }
    }
</style>

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">{$smarty.const.STORE_REPORTS}</a></li>
            <li class="active">{$smarty.const.STORE_WAREHOUSE_BALANCE} </li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">{$smarty.const.STORE_WAREHOUSE_BALANCE}
                <a href="{$youtubes[111]->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="storedetailController.php?do=show" method="post">
                    <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>
                    <input type="hidden" name="childitr" id="childitr" value="1"/>

                    <!--                    <div class="form-group">
                                            <label class="sr-only">تصنيف المنتج</label>
                                            <select class="select2 wdt300 productCatId" data-id="55"  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>
                                        <div id="hereischilds">
                                        </div>-->

                    <div class="form-group">
                        <div class="col-md-2">

                            <label class="sr-only">{$smarty.const.STORE_PRODUCT_RATING}</label>
                        </div>
                        <select class="select2 wdt300 productCat" data-level="0"  name="productCatId0" id="productCatId0" >
                            <option value="-1">{$smarty.const.STORE_CHOOSE_RATING}</option>
                            {foreach $productCatData as $data}
                            <option value="{$data->productCatId}">{$data->productCatName}</option>
                            {/foreach}
                        </select>
                        <input type="hidden" id="level" name="level" value="0">
                    </div>
                    <!--                    <div id="hereischilds">
                                        </div>-->

                    <div class="form-group">
                        <div id="manyParents">

                        </div>
                    </div>

                    <br />

                    {if $searchinonestore neq 0}
                            <div class="form-group">
                                <label class="sr-only">{$smarty.const.STORE_STORE}</label>
                                <input type="hidden" name="storeId" id="storeId"  value="{$storeid}"  >
                                {$storedef->storeName}
                                <input type="hidden" name="storeId_hidden" id="storeId_hidden" value="{$storeid}"/>
                            </div>

                    {else}
                        <div class="form-group">
                            <label class="sr-only">{$smarty.const.STORE_STORE}</label>
                            <select class="select2 wdt300"  name="storeId" id="storeId" >
                                <option value="-1">{$smarty.const.STORE_CHOOSE_STORE}</option>
                                {foreach $stores as $store}
                                <option value="{$store->storeId}">{$store->storeName}</option>
                                {/foreach}
                            </select>
                        </div>
                    {/if}


                  <!--   <div class="form-group">
                        <label class="sr-only">{$smarty.const.STORE_STORE}</label>
                        <select class="select2 wdt300"  name="storeId" id="storeId" >
                            <option value="-1">{$smarty.const.STORE_CHOOSE_STORE}</option>



                            {foreach $storeData as $store}




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


                            {/foreach}



                        </select>
                    </div> -->


                    <div class="form-group">
                        <label class="sr-only">{$smarty.const.STORE_ORDER}</label>
                        <select class="select2 wdt300"  name="order" id="order" >



                            <option value="desc">{$smarty.const.STORE_ORDER_ASCENDING}</option>
                            <option value="asc">{$smarty.const.STORE_ORDER_DESCENDING}</option>






                        </select>
                    </div>
                    <input type="radio" name="search" value="0" checked="checked"/><label>{$smarty.const.STORE_FINAL_PRODUCT}</label>
                    <input type="radio" name="search" value="1"/><label>{$smarty.const.STORE_RATING}</label>

                    <br />
                    <button type="submit" class="btn btn-primary">{$smarty.const.STORE_SEARCH}</button>
                </form>
            </div>
            {if {count($sellbilldata)} > 0}
            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading">{$message}</div>
                <div class="panel-body">
                    <hr/>

                    <!--                    {if {count($sellbilldata)} > 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 dataTableClass">
                        <thead>
                            <tr>
                                <th>{$smarty.const.STORE_NUMBER}</th>
                                <th>{$smarty.const.STORE_CATEGORY_NAME}</th>
                                <th> {$smarty.const.STORE_PRICE_NUMBER_PRODUCTS}</th>
                                {if $showstoredetailprice != 1}<th>{$smarty.const.STORE_PRICE_TOTAL_PRICE_PRODUCTS}</th>{/if}
                            </tr>
                        </thead>
                        <tbody>
                            {assign var=x value=1}
                            {foreach $sellbilldata as $storedetail}
                            {$totQty = $storedetail->totQty|intval}<!-- to avoid zeros of decimal places 0.000 in the condition -->
                            {*$totQty = $storedetail->totQty*1*}<!-- to avoid zeros of decimal places 0.000 in the condition -->
                            {if $totQty neq 0}
                            <tr>
                                <td>{$x}</td>
                                <td>{$storedetail->productCatName}</td>
                                <td>{$storedetail->totQty}</td>
                                {if $showstoredetailprice != 1}<td>{$storedetail->catTotal}</td>{/if}
                            </tr>
                            {capture assign=x}{$x+1}{/capture}
                            {/if}
                            {/foreach}

                        </tbody>

                    </table>
                    <div class="col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center">  {$productquantity} {$smarty.const.STORE_TOTAL_NUMBER_PRODUCTS}</h4>
                        </div>
                    </div>
                    {if $showstoredetailprice != 1}
                    <div class=" col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center"> {$smarty.const.STORE_TOTAL_PRICE_PRODUCTS}{$sumValue} {$currency}</h4>
                        </div>
                    </div>
                    {/if}
                    {/if}
                    <div class="clearfix"></div>
                    <hr />
                    {if {count($sellbilldata)} > 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">{$smarty.const.STORE_PRINT}</button>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    {/if}
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
