<?php /* Smarty version Smarty-3.1.11, created on 2025-02-20 00:09:44
         compiled from "../views/default/storereportview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:13941946467b656a8b6cba1-48022563%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'f843e2bcfb33586c605d7d76b54f0388c9a51d66' => 
    array (
      0 => '../views/default/storereportview/show.html',
      1 => 1740000149,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '13941946467b656a8b6cba1-48022563',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'youtubes' => 0,
    'Programsettingdata' => 0,
    'searchinonestore' => 0,
    'storeid' => 0,
    'storedef' => 0,
    'stores' => 0,
    'store' => 0,
    'storereportData' => 0,
    'message' => 0,
    'Usergroupdata' => 0,
    'sumValue' => 0,
    'currency' => 0,
    'storereport' => 0,
    'x' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_67b656a8c335f6_52447182',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_67b656a8c335f6_52447182')) {function content_67b656a8c335f6_52447182($_smarty_tpl) {?>
<script type="text/javascript" charset="utf-8">
    $("[id^='parcode']").live('keypress', function () {
        if (event.which == '10' || event.which == '13') {
            event.preventDefault();
        }
    });
    function getproductbyParcode(e, value)
    {
        //\s means "one space", and \s+ means "one or more spaces".
        value = value.replace(/\s+/g, '');//\s is the regex for "whitespace", and g is the "global" flag, meaning match ALL \s (whitespaces).
        var code = (e.keyCode ? e.keyCode : e.which);
        //to stop the submit of the form
        if (e.which == 13 && value != "")
        {
            var billnameid = 3;
            value = value.replace("ه", "i");//this replacement is for parcode reader
            value = value.replace("÷", "i");//this replacement is for parcode reader
            value = value.replace("/", "i");//this replacement is for parcode reader
            value = value.replace("I", "i");//this replacement is for parcode reader
            //alert(value.charAt(0));
            $.ajax({
                url: 'sellbillAjaxController.php?do=getproductNamebyOnlyParcode&parcode=' + value + '&billnameid=' + billnameid + '',
                success: function (data) {
                    var response = $.parseJSON(data);
                    $("#productId").select2('data', {id: response.id, text: response.text});
                }
            });
            // }
        }
    }


//
//
//			$(document).ready( function () {
//    $('#example').dataTable( {
//		 "bPaginate": false,
//		 "bStateSave": true,
//        "sDom": 'TCR<"clear">lfrtip',
//        "oTableTools": {
//            "aButtons": [
//                "copy",
//                "print",
//                {
//                    "sExtends":    "collection",
//                    "sButtonText": "حفظ",
//                    "aButtons":    [ "csv", "xls"]
//                }
//            ]
//        }
//    } ).columnFilter();
//} );
</script>


<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="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[112]->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="storereportController.php?do=show" method="post">
                    <input type="hidden" name="searchvalue" id="searchvalue" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->searchvalue;?>
"/>
                   
                    <?php if ($_smarty_tpl->tpl_vars['searchinonestore']->value!=0){?>
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="sr-only"> المخزن</label>
                        </div>
                         <input type="hidden" name="storeId" id="storeId"  value="<?php echo $_smarty_tpl->tpl_vars['storeid']->value;?>
"  >
                        <?php echo $_smarty_tpl->tpl_vars['storedef']->value->storeName;?>

                    </div>
                    <?php }else{ ?>
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="sr-only"> المخزن</label>
                        </div>
                        <select class="select2 wdt300"  name="storeId" id="storeId">
                            <option value="-1">اختر مخزن</option>
                            <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['stores']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['store']->key => $_smarty_tpl->tpl_vars['store']->value){
$_smarty_tpl->tpl_vars['store']->_loop = true;
?>
                            <option value="<?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
"><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
</option>
                            <?php } ?>
                        </select>
                    </div>
                    <?php }?>



                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="sr-only"> المنتج</label>
                        </div>
                        <input type="hidden" class="select2product wdt300"  name="productId" id="productId" data-placeholder="اختر منتج"  />
                    </div>
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="sr-only">الباركود</label>
                        </div>
                        <input type="text" name="parcode" id="parcode" class="form-control" onkeypress="getproductbyParcode(event, this.value);" placeholder="need to press enter">
                    </div>
                    <br />

                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="sr-only"> الترتيب</label>
                        </div>
                        <select class="select2 wdt300"  name="order" id="order" >
                            <option value="asc">تصاعدى</option>
                            <option value="desc">تنازلى</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="sr-only">رصيد صافي</label>
                        <input name="bure" type="checkbox" id="bure" checked="checked" value="1" />
                        <label for="bure"></label>
                    </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>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <?php ob_start();?><?php echo count($_smarty_tpl->tpl_vars['storereportData']->value);?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1>0){?>
            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading"><?php echo $_smarty_tpl->tpl_vars['message']->value;?>
</div>
                <div class="panel-body">
                    <hr/>
                    <div class="hidden-print col-lg-offset-8 col-lg-4 <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى سعر المنتجات <?php echo $_smarty_tpl->tpl_vars['sumValue']->value;?>
 <?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</h4>
                        </div>
                    </div>
                    <table class="table table-black dataTableClass" id="example">
                        <thead>
                            <tr>
                                <th>الرقم</th>
                                <th>المنتج</th>
                                <th>المخزن</th>
                                <th>الكمية قبل</th>
                                <th>الكمية المتغيرة</th>
                                <th>الكمية بعد</th>
                                <th>تاريخ العملية</th>
                                <th>وصف العملية</th>
                                <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices!=1){?><th>السعر </th><?php }?>
                                <th>المستخدم </th>
                                <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices!=1){?><th class="noprint">تفاصيل العملية</th><?php }?>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $_smarty_tpl->tpl_vars['x'] = new Smarty_variable(1, null, 0);?>
                            <?php  $_smarty_tpl->tpl_vars['storereport'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['storereport']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storereportData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['storereport']->key => $_smarty_tpl->tpl_vars['storereport']->value){
$_smarty_tpl->tpl_vars['storereport']->_loop = true;
?>

                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereportid;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2>0){?>
                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereporttype;?>
<?php $_tmp3=ob_get_clean();?><?php if ($_tmp3==1){?>
                            <tr class="danger"> <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereporttype;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==0){?>

                            <tr> <?php }}?>
                                <td><?php echo $_smarty_tpl->tpl_vars['x']->value;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storereport']->value->productName;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storereport']->value->storeName;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storereport']->value->productbefore;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storereport']->value->productquantity;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storereport']->value->productafter;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereportdate;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storereport']->value->processname;?>
<?php if ($_smarty_tpl->tpl_vars['storereport']->value->otherName!=''){?> - <?php echo $_smarty_tpl->tpl_vars['storereport']->value->otherName;?>
<?php }?></td>
                                <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices!=1){?><td><?php echo $_smarty_tpl->tpl_vars['storereport']->value->pricebuy;?>
</td><?php }?>
                                <td><?php echo $_smarty_tpl->tpl_vars['storereport']->value->employeename;?>
</td>
                                <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices!=1){?><td class="noprint"> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereportmodelid;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5!=-1){?>


                                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
<?php $_tmp6=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
<?php $_tmp7=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
<?php $_tmp8=ob_get_clean();?><?php if ($_tmp6=="buyBillController.php"||$_tmp7=="returnBuyBillController.php"||$_tmp8=="buyAndReturnBillController.php"){?>
                                    <a href="<?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
?do=details&id=<?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereportmodelid;?>
" target="_blank" type="button" class="btn btn-default btn-lg editicon"></a>


                                    <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
<?php $_tmp9=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
<?php $_tmp10=ob_get_clean();?><?php if ($_tmp9=="sellbillController.php"||$_tmp10=="sellbillandruternController.php"){?>

                                    <a href="<?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
?do=showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereportmodelid;?>
" target="_blank" type="button" class="btn btn-default btn-lg editicon"></a>


                                    <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
<?php $_tmp11=ob_get_clean();?><?php if ($_tmp11=="returnsellbillController.php"){?>

                                    <a href="<?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
?do=showDetail&returnsellbillid=<?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereportmodelid;?>
" target="_blank" type="button" class="btn btn-default btn-lg editicon"></a>
                                    <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
<?php $_tmp12=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
<?php $_tmp13=ob_get_clean();?><?php if ($_tmp12=="bills.php"||$_tmp13=="billsreturn.php"){?>

                                    <a href="<?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
?do=details&id=<?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereportmodelid;?>
" target="_blank" type="button" class="btn btn-default btn-lg editicon"></a>
                                    <?php }else{ ?>
                                    <a href="<?php echo $_smarty_tpl->tpl_vars['storereport']->value->tablename;?>
?do=editprint&id=<?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereportmodelid;?>
" target="_blank" type="button" class="btn btn-default btn-lg editicon"></a>
                                    <?php }}}}?>
                                    <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storereport']->value->storereportmodelid;?>
<?php $_tmp14=ob_get_clean();?><?php if ($_tmp14==-1){?>

                                    <?php }}?> </td><?php }?>
                            </tr>
                            <?php }?>
                            <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'x', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['x']->value+1;?>
<?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
if (!empty($_capture_buffer)) {
 if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());
 if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());
 Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();
} else $_smarty_tpl->capture_error();?>

                            <?php } ?>

                        </tbody>

                    </table>
                    <div class="col-lg-offset-8 col-lg-4 <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى سعر المنتجات <?php echo $_smarty_tpl->tpl_vars['sumValue']->value;?>
 <?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</h4>
                        </div>
                    </div>
                    <?php }?>
                    <div class="clearfix"></div>
                    <hr />
                    <?php ob_start();?><?php echo count($_smarty_tpl->tpl_vars['storereportData']->value);?>
<?php $_tmp15=ob_get_clean();?><?php if ($_tmp15>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>
                    <?php }?>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
<?php }} ?>