<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
        }
    }

    td.details-control {
        background: url('../views/default/images/details_open.png') no-repeat center center;
        cursor: pointer;
    }
    tr.details td.details-control {
        background: url('../views/default/images/details_close.png') no-repeat center center;
    }

</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_PRICE_STORE_BALANCE_SIZES_COLORS}
                <a href="{$youtubes[117]->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=showsizeandcolor" 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 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}
                    </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 $storeData as $store}
                            <option value="{$store->storeId}">{$store->storeName}</option>
                            {/foreach}
                        </select>
                    </div>
                    {/if}






                    <!--                    <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>-->
                    <input type="hidden" name="search" value="0"/>
                    <!--<input type="radio" name="search" value="0" checked="checked"/><label>منتج نهائى</label>
                        <input type="radio" name="search" value="1"/><label>تصتيف</label>-->

                    <br />
                    <button type="submit" class="btn btn-primary">{$smarty.const.STORE_SEARCH}</button>
                </form>
            </div>
            <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-4">
                        <div class="well well-sm">
                            <h4 class="text-center">{$smarty.const.STORE_TOTAL_NUMBER_NEGATIVE_PRODUCTS}{$minusQuantity}</h4>
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center">{$smarty.const.STORE_TOTAL_NUMBER_POSITIVE_PRODUCTS}{$plusQuantity}</h4>
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center"> {$smarty.const.STORE_TOTAL_NET_NUMBER_PRODUCTS}{$productquantity}</h4>
                        </div>
                    </div>
                    {if $showstoredetailprice != 1}
                    <div class=" col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center">{$smarty.const.STORE_TOTAL_NEGATIVE_PRODUCTS_PRICE}{$minusPrice} {$currency}</h4>
                        </div>
                    </div>
                    <div class=" col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center"> {$smarty.const.STORE_TOTAL_PRICE_POSITIVE_PRODUCTS}{$plusPrice} {$currency}</h4>
                        </div>
                    </div>
                    <div class=" col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center"> {$smarty.const.STORE_TOTAL_NET_PRICE_PRODUCTS}{$sumValue} {$currency}</h4>
                        </div>
                    </div>
                    {/if}
                    {/if}
                    <table class="table table-black dataTableClass">
                        <thead>
                            <tr>
                                <th>{$smarty.const.STORE_NUMBER}</th>
                                <th>{$smarty.const.STORE_STORE_NAME}</th>
                                <th>{$smarty.const.STORE_PRODUCT_NAME}</th>
                                <th> {$smarty.const.STORE_BARCODE}</th>
                                <th>{$smarty.const.STORE_QUANTITY}</th>
                                {if $showstoredetailprice != 1}<th>{$smarty.const.STORE_UNIT_PRICE}</th>{/if}
                                {if $showstoredetailprice != 1}<th>{$smarty.const.STORE_TOTAL}</th>{/if}
                                <th>{$smarty.const.STORE_DATE_LAST_OPERATION}</th>

                            </tr>
                        </thead>
                        <tbody>
                            <!--{assign var=x value=1}-->
                            {foreach $storedetailData as $storedetail}
                            {if $storedetail.productquantity neq '0'}
                            <tr>
                                <td>{$storedetail.itra}</td>
                                <td>{$storedetail.storeName}</td>
                                <td>{$storedetail.productName}</td>
                                <td>{$storedetail.parcode}</td>
                                <td>{$storedetail.productquantity}</td>
                                {if $showstoredetailprice != 1}<td>{$storedetail.productBuyPrice}</td>{/if}
                                {if $showstoredetailprice != 1}<td>{$storedetail.productquantity * $storedetail.productBuyPrice}</td>{/if}
                                <td>{$storedetail.storedetaildate}</td>
                            </tr>
                            {/if}
                            <!--{capture assign=x}{$x+1}{/capture}-->
                            {/foreach}

                        </tbody>

                    </table>
                    <div class=" col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center"> {$smarty.const.STORE_TOTAL_NUMBER_PRODUCTS}{$productquantity}</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}
                    <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">{$smarty.const.STORE_PRINT}</button>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>



                    {/if}
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
