<?php /* Smarty version Smarty-3.1.11, created on 2026-01-18 22:22:40
         compiled from "..\views\default\inventoryview\report.html" */ ?>
<?php /*%%SmartyHeaderCode:8232696d41105e96d1-90852100%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '08a87bafc5c1ad2356c44fe4bb9171026d5c9826' => 
    array (
      0 => '..\\views\\default\\inventoryview\\report.html',
      1 => 1761767330,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '8232696d41105e96d1-90852100',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'youtubes' => 0,
    'storesData' => 0,
    'store' => 0,
    'catData' => 0,
    'data' => 0,
    'manyParcodes' => 0,
    'billsettingsData' => 0,
    'allBillTemplates' => 0,
    'item' => 0,
    'storenegative' => 0,
    'programsettingsdata' => 0,
    'result' => 0,
    'i' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_696d4110b38098_39767547',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_696d4110b38098_39767547')) {function content_696d4110b38098_39767547($_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);
                    $("#product").select2('data', {id: response.id, text: response.text});
                }
            });
            // }
        }
    }
</script>


<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">
            <div class="panel-heading">
                <h3 class="panel-title">تقرير الجرد</h3>
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[58]->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-horizontal" role="form" action="inventoryController.php?do=invReport" method="post">
                    <div class="form-group">
                        <label for="storesData" class="col-lg-2 control-label">المخزن</label>
                        <div class="col-lg-4">
                            <select class="select2 wdt100" 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['storesData']->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>
                    </div>

                    <!-- ================================================= -->
                    <div class="form-group">
                        <label for="catId" class="col-lg-2 control-label">التصنيف الرئيسى</label>
                        <div class="col-lg-4">
                            <select class="select2 wdt100 productCat" data-level="0" name="productCatId0"
                                    id="productCatId0">
                                <option value="-1">اختر تصنيف</option>
                                <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['catData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>
                                <option value="<?php echo $_smarty_tpl->tpl_vars['data']->value->productCatId;?>
"><?php echo $_smarty_tpl->tpl_vars['data']->value->productCatName;?>
</option>
                                <?php } ?>
                            </select>
                        </div>
                        <input type="hidden" id="level" name="level" value="0">
                    </div>

                    <div id="manyParents">

                    </div>

                    <!-- ================================================= -->

                    <div class="form-group">
                        <label for="parent" class="col-lg-2 control-label">المنتج</label>
                        <div class="col-lg-4">
                            <input type="hidden" id="product" name="product" data-placeholder="اختر"
                                   class="select2product wdt100" />
                        </div>
                    </div>

                    <!-- ================================================= -->

                    <div class="form-group">
                        <label for="parent" class="col-lg-2 control-label">الباركود</label>
                        <div class="col-lg-4">
                            <input type="text" name="parcode" id="parcode" class="form-control"
                                   onkeypress="getproductbyParcode(event, this.value);" placeholder="need to press enter">
                        </div>
                        <!--                        <div class="col-lg-2">
                                                    <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value!=1){?>
                                                    <button type="button" class="btn btn-success pull-left ft-nor addManyParcodes"
                                                            id="addManyParcodes" data-type="sell" style="margin-left:3px;">إضافة بالباركود المجمع
                                                    </button>
                                                    <span
                                                        class="col-lg-4 pull-left <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[99]->billsettingsvalue!=1){?> hidden <?php }?> ">
                                                        <select class="select2 wdt100" id="billTemplatesId"
                                                                data-placeholder="الفواتير المحفوظة">
                                                            <option value=""></option>
                                                            <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allBillTemplates']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value){
$_smarty_tpl->tpl_vars['item']->_loop = true;
?>
                                                            <option value="<?php echo $_smarty_tpl->tpl_vars['item']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['item']->value->name;?>
</option>
                                                            <?php } ?>
                                                        </select>
                                                        <?php }?>
                                                    </span>
                                                </div>-->
                        <div class="col-lg-1"><button type="submit" class="btn btn-primary pull-left"
                                                      id="searchnow">بحث</button></div>
                    </div>


                    <div class="form-group">
                        <label for="parent" class="col-lg-2 control-label">التاريخ من</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control awdatepicker " autocomplete="off"
                                   data-date-format="yyyy-mm-dd" id="from" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="parent" class="col-lg-2 control-label">التاريخ الى</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control awdatepicker " autocomplete="off"
                                   data-date-format="yyyy-mm-dd" id="to" value="">
                        </div>
                    </div>



                    <!-- ================================================= -->
                    <div id="productsDiv">

                    </div>
                    <input name="storenegative" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['storenegative']->value;?>
" id="storenegative" />
                    <!--  <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit"  class="btn btn-primary pull-left">حفظ</button>
                        </div>
                    </div> -->
                </form>
                <input type="hidden" name="searchvalue"  value="<?php echo $_smarty_tpl->tpl_vars['programsettingsdata']->value->searchvalue;?>
" /><!--id="searchvalue"-->
                <table class="dataTableClass" id="productsTable">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>المنتج</th>
                            <th>التصنيف</th>
                            <th>التاريخ</th>
                            <th>قبل الجرد</th>
                            <th>بعد الجرد</th>
                            <th>الهالك بالزياده</th>
                            <th>الهالك بالنقص</th>
                            <th>المستخدم</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['result']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>
                        <tr>
                            <td><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['productName'];?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['productCatName'];?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['storereportdate'];?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['productbefore'];?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['productafter'];?>
</td>
                            <td><?php if ($_smarty_tpl->tpl_vars['data']->value['productbefore']<=$_smarty_tpl->tpl_vars['data']->value['productafter']){?><?php echo abs($_smarty_tpl->tpl_vars['data']->value['productquantity']);?>
<?php }?></td>
                            <td><?php if ($_smarty_tpl->tpl_vars['data']->value['productbefore']>$_smarty_tpl->tpl_vars['data']->value['productafter']){?><?php echo abs($_smarty_tpl->tpl_vars['data']->value['productquantity']);?>
<?php }?></td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['employeename'];?>
</td>
                        </tr>
                        <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable($_smarty_tpl->tpl_vars['i']->value+1, null, 0);?>
                        <?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>


<!-- Modal -->
<div class="modal fade" id="myModalManyParcodes" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-left savemodel2" data-dismiss="modal"
                        aria-hidden="true">&times;</button>
                <h4 class="modal-title">اضافة منتجات بالباركود المجمع</h4>
            </div>
            <div class="modal-body">
                <form id="manyParcodesForm" action="inventoryControllerAjax.php?do=addManyParcodes" method="post"
                      class="form-horizontal">
                    <div class="form-group">
                        <label for="debtLimit" class="col-lg-3 control-label">الباركودات مجمعة</label>
                        <div class="col-lg-9">
                            <textarea name="manyParcodes" class="form-control" style="background: url(http://i.imgur.com/2cOaJ.png);
                                      background-attachment: local;
                                      background-repeat: no-repeat;
                                      padding-left: 35px;
                                      padding-top: 10px;
                                      text-align: left !important;
                                      border-color:#ccc;
                                      direction: ltr;" id="manyParcodes" rows="5"></textarea>

                        </div>
                        <div id='hazemc'>1</div>
                    </div>
                    <input type="hidden" name="manyParcodesstoreid" id="manyParcodesstoreid" value="" />
                    <input type="hidden" name="manyParcodesproductCatId" id="manyParcodesproductCatId" value="" />
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default savemodel2" data-dismiss="modal">الغاء</button>
                <button type="button" class="btn btn-primary" id="doAddManyParcodes">تم</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->


<script type="text/javascript">
    $(document).on('click', "#addManyParcodes", function () {
        if ($('#storeId').val() == "-1" || $('#storeidto').val() == "-1") {
            alert('اختر المخزن اولا');
        } else {
            $('#myModalManyParcodes').modal('show');
            setTimeout(function () {
                $('#manyParcodes').focus();
            }, 800);
        }
    });


</script>
<?php }} ?>