<?php /* Smarty version Smarty-3.1.11, created on 2026-01-18 22:23:13
         compiled from "..\views\default\inventoryview\products.html" */ ?>
<?php /*%%SmartyHeaderCode:13061696d4131b0de27-61274941%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '3e206d3ce59d68564b5f942823e22df67deb7e56' => 
    array (
      0 => '..\\views\\default\\inventoryview\\products.html',
      1 => 1752437506,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '13061696d4131b0de27-61274941',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'showMore' => 0,
    'Programsettingdata' => 0,
    'productData' => 0,
    'beforeAfter' => 0,
    'lastInventoryDate' => 0,
    'pro' => 0,
    'i' => 0,
    'showMoreSetting' => 0,
    'lastItr' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_696d4132203cb9_92966583',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_696d4132203cb9_92966583')) {function content_696d4132203cb9_92966583($_smarty_tpl) {?><?php if ($_smarty_tpl->tpl_vars['showMore']->value==0){?>
<style>
    .showMoreStyle td{
        text-align: center;
        font-size: 12px;
        font-weight: bold;
        color: white !important;
        background-color: #6e6e6e;
        padding: 1px !important;
        cursor: pointer;
    }
</style>

<a class="btn btn-success" id="makeEmptyQuantityZero" style="float: left">ضع الكميةالجديدة الفارغة بصفر</a>
<table class="table table-black dataTableClass" id="productsTable">
    <thead>
        <tr>
            <th>إسم المنتج</th>
            <th class="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==1){?> hidden <?php }?>">الباركود</th>
            <th>الكمية الحالية</th>
            <th>الكمية الجديدة</th>
            <th>المخزن</th>
            <th>تاريخ آخر إعادة جرد</th>
            <th></th>
        </tr>
    </thead>
    <tbody id="productsTBody">

        <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
        <?php  $_smarty_tpl->tpl_vars['pro'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['pro']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['productData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['pro']->key => $_smarty_tpl->tpl_vars['pro']->value){
$_smarty_tpl->tpl_vars['pro']->_loop = true;
?>
        
        <?php if (($_smarty_tpl->tpl_vars['beforeAfter']->value==1&&$_smarty_tpl->tpl_vars['lastInventoryDate']->value&&$_smarty_tpl->tpl_vars['lastInventoryDate']->value<$_smarty_tpl->tpl_vars['pro']->value->lastInventoryDate)||!$_smarty_tpl->tpl_vars['lastInventoryDate']->value||($_smarty_tpl->tpl_vars['beforeAfter']->value==2&&$_smarty_tpl->tpl_vars['lastInventoryDate']->value&&$_smarty_tpl->tpl_vars['lastInventoryDate']->value>$_smarty_tpl->tpl_vars['pro']->value->lastInventoryDate)||!$_smarty_tpl->tpl_vars['pro']->value->lastInventoryDate){?>


        <?php if ($_smarty_tpl->tpl_vars['pro']->value->status==1){?>
        <tr class="success">
            <?php }else{ ?>
        <tr>
            <?php }?>
            <td><?php echo $_smarty_tpl->tpl_vars['pro']->value->productName;?>
</td>
            <td class="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2==1){?> hidden <?php }?>"><?php echo $_smarty_tpl->tpl_vars['pro']->value->parcode;?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['pro']->value->productquantity;?>
</td>
            <td>
                <input name="newQty<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="newQty<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="text" class="autosave"  onkeyup="checkdata(<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
);"/>
                <input name="productId<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productId<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->productid;?>
" />
                <input name="storedetailid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="storedetailid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->storedetailid;?>
" />
                <input name="oldQty<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="oldQty<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->productquantity;?>
" />
                <input name="storeid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="storeid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->storeid;?>
" />
            </td>
            <td><?php echo $_smarty_tpl->tpl_vars['pro']->value->storeName;?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['pro']->value->lastInventoryDate;?>
</td>
            <td><input type="button" class="btn btn-success pull-left ft-nor getSerials" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-proid="<?php echo $_smarty_tpl->tpl_vars['pro']->value->productid;?>
" data-storeid="<?php echo $_smarty_tpl->tpl_vars['pro']->value->storeid;?>
" value="السيريالات"/></td>
        </tr>
        
        
        <?php }?>
        <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'i', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['i']->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>
    <?php if ($_smarty_tpl->tpl_vars['showMoreSetting']->value==0){?>
    <tfoot>
        <tr class="showMore showMoreStyle" data-lid="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-page="1"><td colspan="6"> عـــرض المزيـــد</td></tr>
    </tfoot>
    <?php }?>

</table>
<!--<input name="itr" id="itr" type="hidden" value="<?php echo count($_smarty_tpl->tpl_vars['productData']->value);?>
" />-->

<?php }elseif($_smarty_tpl->tpl_vars['showMore']->value==1){?>

<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['lastItr']->value;?>
<?php $_tmp3=ob_get_clean();?><?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable($_tmp3, null, 0);?>
<?php  $_smarty_tpl->tpl_vars['pro'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['pro']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['productData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['pro']->key => $_smarty_tpl->tpl_vars['pro']->value){
$_smarty_tpl->tpl_vars['pro']->_loop = true;
?>

<?php if (($_smarty_tpl->tpl_vars['beforeAfter']->value==1&&$_smarty_tpl->tpl_vars['lastInventoryDate']->value&&$_smarty_tpl->tpl_vars['lastInventoryDate']->value<$_smarty_tpl->tpl_vars['pro']->value->lastInventoryDate)||!$_smarty_tpl->tpl_vars['lastInventoryDate']->value||($_smarty_tpl->tpl_vars['beforeAfter']->value==2&&$_smarty_tpl->tpl_vars['lastInventoryDate']->value&&$_smarty_tpl->tpl_vars['lastInventoryDate']->value>$_smarty_tpl->tpl_vars['pro']->value->lastInventoryDate)||!$_smarty_tpl->tpl_vars['pro']->value->lastInventoryDate){?>


<?php if ($_smarty_tpl->tpl_vars['pro']->value->status==1){?>
<tr class="success">
    <?php }else{ ?>
<tr>
    <?php }?>
    <td><?php echo $_smarty_tpl->tpl_vars['pro']->value->productName;?>
</td>
    <td class="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==1){?> hidden <?php }?>"><?php echo $_smarty_tpl->tpl_vars['pro']->value->parcode;?>
</td>
    <td><?php echo $_smarty_tpl->tpl_vars['pro']->value->productquantity;?>
</td>
    <td>
        <input name="newQty<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="newQty<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="text" class="autosave"  onkeyup="checkdata(<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
);"/>
        <input name="productId<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productId<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->productid;?>
" />
        <input name="storedetailid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="storedetailid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->storedetailid;?>
" />
        <input name="oldQty<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="oldQty<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->productquantity;?>
" />
        <input name="storeid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="storeid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->storeid;?>
" />
    </td>
    <td><?php echo $_smarty_tpl->tpl_vars['pro']->value->storeName;?>
</td>
    <td><?php echo $_smarty_tpl->tpl_vars['pro']->value->lastInventoryDate;?>
</td>
    <td><input type="button" class="btn btn-success pull-left ft-nor getSerials" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-proid="<?php echo $_smarty_tpl->tpl_vars['pro']->value->productid;?>
" data-storeid="<?php echo $_smarty_tpl->tpl_vars['pro']->value->storeid;?>
" value="السيريالات"/></td>
</tr>


<?php }?>
<?php $_smarty_tpl->_capture_stack[0][] = array('default', 'i', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['i']->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 } ?>

<input type="hidden" id="lid_temp" value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
">
<?php }?>


<?php }} ?>