<?php /* Smarty version Smarty-3.1.11, created on 2025-02-19 23:52:10
         compiled from "../views/default/sellbillview/bill.html" */ ?>
<?php /*%%SmartyHeaderCode:13542932096799282a4deb09-74887399%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '47a32df2fdab2e34c16a14f9c57a487ad2f4b50e' => 
    array (
      0 => '../views/default/sellbillview/bill.html',
      1 => 1740000149,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '13542932096799282a4deb09-74887399',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_6799282b183cb4_50521031',
  'variables' => 
  array (
    'printURL' => 0,
    'productData' => 0,
    'product' => 0,
    'returnproductData' => 0,
    'returnproduct' => 0,
    'categoriesData' => 0,
    'cat' => 0,
    'unitsData' => 0,
    'unit' => 0,
    'storeData' => 0,
    'store' => 0,
    'userdata' => 0,
    'Programsettingdata' => 0,
    'allDiscounts' => 0,
    'Usergroupdata' => 0,
    'clientidFromGET' => 0,
    'billsettingsData' => 0,
    'manyParcodes' => 0,
    'myclientdata' => 0,
    'lang_code' => 0,
    'mylastbill' => 0,
    'tempSaveBillId' => 0,
    'unique' => 0,
    'nextId' => 0,
    'today' => 0,
    'mysellbilldata' => 0,
    'date' => 0,
    'allCostcenter' => 0,
    'myallCostcenter' => 0,
    'clientData' => 0,
    'client' => 0,
    'manyParcodesSupplier' => 0,
    'y' => 0,
    'manyParcodesPriceType' => 0,
    'manyParcodesStoreid' => 0,
    'allSaves' => 0,
    'data' => 0,
    'manyParcodesSaveid' => 0,
    'sessionSave' => 0,
    'allCurrency' => 0,
    'currency' => 0,
    'sellerData' => 0,
    'seller' => 0,
    'manyParcodesSellerid' => 0,
    'billOperations' => 0,
    'addManyParcodebilloperationid' => 0,
    'addManyParcodeobgyBillType' => 0,
    'knownWays' => 0,
    'way' => 0,
    'billnameid' => 0,
    'userSaveData' => 0,
    'billnameData' => 0,
    'offerId' => 0,
    'allBillTemplates' => 0,
    'item' => 0,
    'detalesitr' => 0,
    'mysellbildetales' => 0,
    'x' => 0,
    'mymysellbildetales' => 0,
    'mymyunitdata' => 0,
    'ex' => 0,
    'sellbilldetailtax' => 0,
    'returndetalesitr' => 0,
    'returnmysellbildetales' => 0,
    'myreturnmysellbildetales' => 0,
    'remymyunitdata' => 0,
    'billnameAddData' => 0,
    'bankAccounts' => 0,
    'acc' => 0,
    'roundNumbersStatus' => 0,
    'noOfDecimalPlaces' => 0,
    'previousPriceStatus' => 0,
    'storenegative' => 0,
    'allclientarea' => 0,
    'myallclientarea' => 0,
    'allDelegate' => 0,
    'delegate' => 0,
    'typeClient' => 0,
    'catDataReport' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6799282b183cb4_50521031')) {function content_6799282b183cb4_50521031($_smarty_tpl) {?><input type="hidden" name="printURL" id="printURL" value="<?php echo $_smarty_tpl->tpl_vars['printURL']->value;?>
" />
<script>
    var printURL = $('#printURL').val();
    if (printURL != "") {
        window.open(printURL);
    }
</script>
<!-- === here the drop down list that fill the product list === -->
<style>
    .serial-success {
        background-color: #6ed96e !important;
    }

    .serial-error {
        background-color: #f47c7c !important;
    }

    .proDetails {
        cursor: pointer;
    }

    .proDetails:hover {
        text-decoration: underline;
        color: blue;
        font-weight: bold;
    }

    .newoption {
        background-color: #CCCCCC !important;
        font-weight: bold !important;
    }

    /*for select2-drop of product*/
    .largeWidthForDropDown {
        width: 500px !important;
    }

    #manyParents .form-group label {
        margin-left: 11px;
        margin-right: 16px;
    }

    #manyParents .form-group div {
        width: 155px;
    }


    /* -- progress bar ------------------------------------------------------ */
    #myProgress {
        width: 100%;
        background-color: #ddd;
    }

    #myBar {
        width: 0%;
        height: 20px;
        background-color: #04AA6D;
        text-align: center;
        color: white;
    }

    /* ---------------------------------------------------------------------- */
    .small-addon {
        border-right: 1px solid #ccc !important;
        padding: 4px 4px;
        width: 25px;
    }
</style>
<script type="application/javascript">
    //$(document).ready(function(e) {
    //
    //	$("#pronum1").keydown(function(e) {
    //   // test for the enter key
    //	   if (e.keyCode == 40) {
    //		   alert(this.name);
    //		  // Do your function
    //		  $("#pronum2").select();
    //	 //    alert("sfdsfds");
    //	   }
    //
    //
    //	});
    //
    //
    //
    //		$("#textfield2").keydown(function(e) {
    //			   // test for the enter key
    //			   if (e.keyCode == 38) {
    //				  // Do your function
    //				  $("#textfield").select();
    //			 //    alert("sfdsfds");
    //			   }
    //
    //		});
    //
    //});
</script>
<div id="addrowcreated" style="display:none">
    <option value="-1"> </option>
    <?php  $_smarty_tpl->tpl_vars['product'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['product']->_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['product']->key => $_smarty_tpl->tpl_vars['product']->value){
$_smarty_tpl->tpl_vars['product']->_loop = true;
?>
    <option value="<?php echo $_smarty_tpl->tpl_vars['product']->value->productId;?>
"><?php echo $_smarty_tpl->tpl_vars['product']->value->productName;?>
 </option>
    <?php } ?>
</div>
<div id="addreturnproduct" style="display:none"> <?php  $_smarty_tpl->tpl_vars['returnproduct'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['returnproduct']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['returnproductData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['returnproduct']->key => $_smarty_tpl->tpl_vars['returnproduct']->value){
$_smarty_tpl->tpl_vars['returnproduct']->_loop = true;
?>
    <option value="-1"> </option>
    <option value="<?php echo $_smarty_tpl->tpl_vars['returnproduct']->value->productId;?>
"><?php echo $_smarty_tpl->tpl_vars['returnproduct']->value->productName;?>
 </option>
    <?php } ?>
</div>
<div id="addProductCat" style="display:none;"> <?php  $_smarty_tpl->tpl_vars['cat'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['cat']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['categoriesData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['cat']->key => $_smarty_tpl->tpl_vars['cat']->value){
$_smarty_tpl->tpl_vars['cat']->_loop = true;
?>
    <option value="<?php echo $_smarty_tpl->tpl_vars['cat']->value->productCatId;?>
"><?php echo $_smarty_tpl->tpl_vars['cat']->value->productCatName;?>
</option>
    <?php } ?>
</div>
<div id="addNewUnit" style="display:none;"> <?php  $_smarty_tpl->tpl_vars['unit'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['unit']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['unitsData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['unit']->key => $_smarty_tpl->tpl_vars['unit']->value){
$_smarty_tpl->tpl_vars['unit']->_loop = true;
?>
    <option value="<?php echo $_smarty_tpl->tpl_vars['unit']->value->unitId;?>
"><?php echo $_smarty_tpl->tpl_vars['unit']->value->unitName;?>
</option>
    <?php } ?>
</div>


<div id="addstore" class="clientstore" style="display:none;">
    <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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 } ?>

</div>
<div id="addstore2" class="clientstoretxt" style="display:none;">
    <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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;
?>
    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp1=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp1==$_tmp2){?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
 <?php }?>
    <?php } ?>
</div>
<!-- === end of drop down list === -->
<input name="valueaddeddiscount" id="valueaddeddiscount" type="hidden"
       value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->valueaddeddiscount;?>
" />
<input name="clientPhoneReq" id="clientPhoneReq" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->clientPhoneReq;?>
" />
<input name="addServiceToBill" id="addServiceToBill" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->addServiceToBill;?>
" />
<input name="showPrevDiscount" id="showPrevDiscount" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->showPrevDiscount;?>
" />
<input type="hidden" name="scunitnamevalue" id="scunitnamevalue" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->scunitname;?>
" />
<input type="hidden" name="usedParcode" id="usedParcode" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->usedParcode;?>
" />
<input type="hidden" name="valueadded" id="valueadded" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->valueadded;?>
" />
<input type="hidden" name="sendBillToRestaurant" id="sendBillToRestaurant"
       value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->sendBillToRestaurant;?>
" />
<input type="hidden" name="defaultUnitPriceAtBill" id="defaultUnitPriceAtBill"
       value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->defaultUnitPriceAtBill;?>
" />
<input type="hidden" name="showpriceall" id="showpriceall" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall;?>
" />
<input type="hidden" name="showpricehalf" id="showpricehalf" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf;?>
" />
<input type="hidden" name="showpriceunit" id="showpriceunit" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit;?>
" />
<input type="hidden" name="showprice4" id="showprice4" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4;?>
" />
<input type="hidden" name="showprice5" id="showprice5" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5;?>
" />
<input type="hidden" name="showprice6" id="showprice6" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6;?>
" />
<input type="hidden" name="showprice7" id="showprice7" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7;?>
" />
<input type="hidden" name="showprice8" id="showprice8" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8;?>
" />
<input type='hidden' name='allDiscounts' id='allDiscounts' value='<?php echo $_smarty_tpl->tpl_vars['allDiscounts']->value;?>
' />
<input type="hidden" name="stopDiscountOfTotalControl" id="stopDiscountOfTotalControl"
       value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->stopDiscountOfTotalControl;?>
" />
<input type="hidden" name="discountOfTotalControlEditable" id="discountOfTotalControlEditable"
       value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->discountOfTotalControlEditable;?>
" />
<input type="hidden" name="discountOfTotalControlMTGDA" id="discountOfTotalControlMTGDA"
       value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->discountOfTotalControlMTGDA;?>
" />
<input type="hidden" name="supplierWithAddOption" id="supplierWithAddOption"
       value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->addClientInBill;?>
" />
<input type="hidden" name="withNakdi" id="withNakdi" value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->showClientAndSupplierOne;?>
" />
<input type="hidden" name="hideBillPrices" id="hideBillPrices" value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices;?>
" />
<input type="hidden" name="clientidFromGET" id="clientidFromGET" value="<?php echo $_smarty_tpl->tpl_vars['clientidFromGET']->value;?>
" />
<input type="hidden" name="searchWithCatAndProductNameOnly" id="searchWithCatAndProductNameOnly"
       value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[97]->billsettingsvalue;?>
" />
<input type="hidden" name="activateAutoSave" id="activateAutoSave" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[98]->billsettingsvalue;?>
" />
<input type="hidden" name="clientType" id="clientType" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[103]->billsettingsvalue;?>
" />
<input type="hidden" name="manyParcodesFlag" id="manyParcodesFlag" value="<?php echo $_smarty_tpl->tpl_vars['manyParcodes']->value;?>
" />
<input type="hidden" name="supplieridBeforeChange" id="supplieridBeforeChange" value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->clientid;?>
" />
<input type="hidden" name="suppliernameBeforeChange" id="suppliernameBeforeChange"
       value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->clientname;?>
" />
<input type="hidden" id="retOnlySoldProducts" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[105]->billsettingsvalue;?>
" />
<input type="hidden" id="checkRedundantProducts" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[107]->billsettingsvalue;?>
" />

<input type="hidden" id="hideBuyPrice" value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->showstoredetailprice;?>
" />
<!-- === here the drop down list that fill the product list === -->

<div id="addunit" style="display:none"> </div>
<!-- === end of drop down list === -->

<div class="container <?php if ($_smarty_tpl->tpl_vars['lang_code']->value=='en'){?> gt4-ltr<?php }?>">
    <div class="bill-mobile ">
        <ol class="breadcrumb">
            <li><a href="#"><?php echo @SELL_BILL_BILLING_MANAGEMENT;?>
</a></li>
            <li><a href="sellbillController.php?do=addsellBill&billnameid=3"><?php echo @SELL_BILL_SALES_INVOICE;?>
</a>
            </li>
            <li class="active"><?php echo @SELL_BILL_ADD_INVOICE;?>
</li>


        </ol>



        <h3><?php echo @SELL_BILL_BILLING_MANAGEMENT;?>
</h3>
        <?php if ($_smarty_tpl->tpl_vars['mylastbill']->value->sellbillid>0){?>
        <h3><a class="color-white"
               href="sellbillController.php?do=showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['mylastbill']->value->sellbillid;?>
"><?php echo @SELL_BILL_PREVIOUS_INVOICE;?>

            </a> </h3>
        <?php }?>
        <hr />
        
        <form class="form-horizontal " role="form" action="sellbillController.php?do=add" method="post"
              id="sellbillForm" onsubmit="

                      //check if muliple clients to make sure user is choosing one client at least then validate form
                      if ($('.multiSupp').is(':visible'))
                      {
                          var foo = [];
                          $('#supplier :selected').each(function (i, selected) {
                              foo[i] = $(selected).text();
                          });
                          if (foo.length === 0) {
                              alert('من فضلك اختر عميل واحد على الاقل');
                              return false;
                          } else
                          {
                              if (Spry.Widget.Form.validate(this)) {
                                  $('#saveAndNew').css('display', 'none');
                                  $('#saveBill').css('display', 'none');
                                  if ($('#saveAndPrint').length > 0)
                                      $('#saveAndPrint').css('display', 'none');
                                  if ($('#saveAndNewOrder').length > 0)
                                      $('#saveAndNewOrder').css('display', 'none');
                                  if ($('#saveAndSend').length > 0)
                                      $('#saveAndSend').css('display', 'none');
                                  return true;
                              } else {
                                  return false;
                              }
                          }
                      } else
                      {
                          if (Spry.Widget.Form.validate(this)) {
                              $('#saveAndNew').css('display', 'none');
                              $('#saveBill').css('display', 'none');
                              if ($('#saveAndPrint').length > 0)
                                  $('#saveAndPrint').css('display', 'none');
                              if ($('#saveAndNewOrder').length > 0)
                                  $('#saveAndNewOrder').css('display', 'none');
                              if ($('#saveAndSend').length > 0)
                                  $('#saveAndSend').css('display', 'none');
                              return true;
                          } else {
                              return false;
                          }
                      }

              ">
            
            <input type="hidden" name="tempSaveBillId" id="tempSaveBillId" value="<?php echo $_smarty_tpl->tpl_vars['tempSaveBillId']->value;?>
">
            <div class="row">
                <div class="col-lg-8">
                    <div class="form-group" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[61]->billsettingsvalue;?>
<?php $_tmp3=ob_get_clean();?><?php if ($_tmp3==0){?> style="display:block"
                        <?php }else{ ?> style="display:none" <?php }?>>
                        <label class="col-lg-3 col-sm-5 control-label"> <?php echo @SELL_BILL_INVOICE_NUMBER;?>
</label>
                        <div class="col-lg-4 col-sm-7">
                            <input type="text" name="bns" id="bns" value="<?php echo $_smarty_tpl->tpl_vars['unique']->value;?>
" class="form-control"
                                   placeholder="<?php echo @SELL_BILL_INVOICE_NUMBER;?>
 ">
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientserial==1){?>
                    <div class="form-group">
                        <label class="col-lg-3 col-sm-5 control-label"><?php echo @SELL_BILL_SERIAL_NUMBER;?>
 </label>
                        <div class="col-lg-4 col-sm-7">
                            <input type="text" class="form-control" disabled readonly value="<?php echo $_smarty_tpl->tpl_vars['nextId']->value;?>
">
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <?php }?>
                    <div class="form-group" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[5]->billsettingsvalue;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==0){?> style="display:block"
                        <?php }else{ ?> style="display:none" <?php }?> >
                        <label class="col-lg-3 col-sm-5 control-label"><?php echo @SELL_BILL_INVOICE_DATE;?>
</label>
                        <div class="col-lg-4 col-sm-7"> <span id="sprydate">
                                <!--input type="text" class="form-control awdatepicker" autocomplete="off"  data-date-format="yyyy-mm-dd" placeholder="تاريخ الفاتورة" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->allowdateedit==1){?>disabled="disabled"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['today']->value;?>
" name="bn" id="bn"-->
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->allowdateedit==1){?>
                                <input type="text" class="form-control"
                                       placeholder=" <?php echo @SELL_BILL_INVOICE_DATE;?>
" readonly value="<?php echo $_smarty_tpl->tpl_vars['today']->value;?>
"
                                       name="bn" id="bn">
                                <?php }else{ ?>
                                <div class="input-group date form_datetime col-md-5" data-date=""
                                     data-date-format="yyyy-mm-dd  h:i:s" data-link-field="dtp_input1">
                                    <input class="form-control autoSaveBillMainPart" size="16" type="text"
                                           value="<?php if ($_smarty_tpl->tpl_vars['tempSaveBillId']->value>0){?><?php echo $_smarty_tpl->tpl_vars['mysellbilldata']->value->sellbilldate;?>
<?php echo $_smarty_tpl->tpl_vars['mysellbilldata']->value->returnsellbilldate;?>
<?php }else{ ?><?php echo $_smarty_tpl->tpl_vars['today']->value;?>
<?php }?>"
                                           name="bn" id="bn" readonly="">
                                    <span class="input-group-addon "><span
                                            class=" glyphicon glyphicon-remove col-lg-4"></span></span>
                                    <span class="input-group-addon"><span
                                            class="glyphicon glyphicon-th col-lg-4"></span></span>
                                </div><?php }?>
                                <span class="textfieldRequiredMsg">*</span>
                            </span> </div>
                    </div>
                    <!-- end of form-group-->

                    <div class="form-group" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[50]->billsettingsvalue;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-3 col-sm-4 control-label"><?php echo @SELL_BILL_TEMPORARY_CLIENT_NAME;?>

                        </label>
                        <div class="col-lg-4 col-sm-8"> <span id="sprytempname">
                                <input type="text" class="form-control autoSaveBillMainPart"
                                       placeholder="<?php echo @SELL_BILL_TEMPORARY_CLIENT_NAME;?>
 " name="tempclientName"
                                       id="tempclientName"
                                       value="<?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1){?><?php echo $_smarty_tpl->tpl_vars['mysellbilldata']->value->tempclientName;?>
<?php }else{ ?>نقدى<?php }?>" />
                                <span class="textfieldRequiredMsg">*</span></span> </div>
                    </div>

                    <div class="form-group" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[102]->billsettingsvalue;?>
<?php $_tmp6=ob_get_clean();?><?php if ($_tmp6==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-3 control-label"><?php echo @SELL_BILL_DATE_OF_STARTING;?>
 </label>
                        <div class="col-lg-4"> <span id="sprydate">
                                <input type="text" class="form-control awdatepicker" autocomplete="off"
                                       data-date-format="yyyy-mm-dd"
                                       placeholder="<?php echo @SELL_BILL_DATE_OF_STARTING;?>
" value="<?php echo $_smarty_tpl->tpl_vars['date']->value;?>
"
                                       name="datestarting">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <div class="form-group" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[110]->billsettingsvalue;?>
<?php $_tmp7=ob_get_clean();?><?php if ($_tmp7==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-3 control-label"><?php echo @SELL_BILL_STATUS;?>
 </label>
                        <div class="col-lg-4">
                            <?php echo @SELL_BILL_STATUS_NEW;?>

                        </div>
                    </div>
                    <!-- end of form-group-->

                    <!-- ahmed -->

                    <div <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[35]->billsettingsvalue;?>
<?php $_tmp8=ob_get_clean();?><?php if ($_tmp8==0){?> <?php }else{ ?> style="display:none" <?php }?> >

                        <div class="form-group">
                            <label class="col-lg-3  col-sm-4 control-label"><?php echo @SELL_BILL_CAR_NUMBER;?>

                            </label>
                            <div class="col-lg-4  col-sm-8"> <span id="sprytempname">
                                    <input type="text" class="form-control"
                                           placeholder="<?php echo @SELL_BILL_CAR_NUMBER;?>
" name="carNumber"
                                           id="carNumber" />
                                    <span class="textfieldRequiredMsg">*</span></span> </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3  col-sm-4 control-label"><?php echo @SELL_BILL_CAR_TYPE;?>
</label>
                            <div class="col-lg-4  col-sm-8"> <span id="sprytempname">
                                    <input type="text" class="form-control"
                                           placeholder="<?php echo @SELL_BILL_CAR_TYPE;?>
 " name="carType" id="carType" />
                                    <span class="textfieldRequiredMsg">*</span></span> </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3  col-sm-4 control-label"><?php echo @SELL_BILL_CAR_CHASSIS;?>

                            </label>
                            <div class="col-lg-4  col-sm-8"> <span id="sprytempname">
                                    <input type="text" class="form-control"
                                           placeholder="<?php echo @SELL_BILL_CAR_CHASSIS;?>
  " name="carChase"
                                           id="carChase" />
                                    <span class="textfieldRequiredMsg">*</span></span> </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3  col-sm-4 control-label"><?php echo @SELL_BILL_CAR_MOTOR;?>
 </label>
                            <div class="col-lg-4  col-sm-8"> <span id="sprytempname">
                                    <input type="text" class="form-control"
                                           placeholder=" <?php echo @SELL_BILL_CAR_MOTOR;?>
" name="carMotor"
                                           id="carMotor" />
                                    <span class="textfieldRequiredMsg">*</span></span> </div>
                        </div>

                        <!-- end of form-group-->

                    </div>


                    <div <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[39]->billsettingsvalue;?>
<?php $_tmp9=ob_get_clean();?><?php if ($_tmp9==0){?> <?php }else{ ?> style="display:none" <?php }?> >
                        <div id="divclientdata">
                            <div class="form-group">
                                <label
                                    class="col-lg-3 col-sm-6 control-label"><?php echo @SELL_BILL_CUSTOMER_ADDRESS;?>
</label>
                                <div class="col-lg-4 col-sm-6">

                                </div>
                            </div>

                            <div class="form-group">
                                <label
                                    class="col-lg-3 col-sm-6 control-label"><?php echo @SELL_BILL_PHONE_NUMBER;?>
</label>
                                <div class="col-lg-4 col-sm-6">

                                </div>


                            </div>


                            <div class="form-group">
                                <label
                                    class="col-lg-3 col-sm-6 control-label"><?php echo @SELL_BILL_CLIENT_CODE;?>
</label>
                                <div class="col-lg-4 col-sm-6">

                                </div>


                            </div>

                        </div>

                    </div>
                </div>

                <!-- end of bill no-->
                <div class="col-lg-4">
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[45]->billsettingsvalue;?>
<?php $_tmp10=ob_get_clean();?><?php if ($_tmp10==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_COST_CENTER;?>
</label>
                        <div class="col-lg-8 col-sm-8">

                            <select class="select2 wdt100" name="Costcenter" id="Costcenter">


                                <option value="-1"><?php echo @SELL_BILL_SELECT_COST_CENTER;?>
</option>
                                <?php  $_smarty_tpl->tpl_vars['myallCostcenter'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['myallCostcenter']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allCostcenter']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['myallCostcenter']->key => $_smarty_tpl->tpl_vars['myallCostcenter']->value){
$_smarty_tpl->tpl_vars['myallCostcenter']->_loop = true;
?>



                                <option value="<?php echo $_smarty_tpl->tpl_vars['myallCostcenter']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['myallCostcenter']->value->name;?>
</option>

                                <?php } ?>


                            </select>
                        </div>
                    </div>
                    <!-- end of form-group-->

                </div>
                <div class="col-lg-4">

                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[37]->billsettingsvalue;?>
<?php $_tmp11=ob_get_clean();?><?php if ($_tmp11==1){?>
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[1]->billsettingsvalue;?>
<?php $_tmp12=ob_get_clean();?><?php if ($_tmp12==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_CLIENT_NAME;?>
</label>
                        <div class="col-lg-8 col-sm-8"> <span id="spryclient">
                                <div id="clientDiv">
                                    <!--                                    <select class="select2Supp wdt100" name="supplier" id="supplier" >


                                                                            <?php  $_smarty_tpl->tpl_vars['client'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['client']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['clientData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['client']->key => $_smarty_tpl->tpl_vars['client']->value){
$_smarty_tpl->tpl_vars['client']->_loop = true;
?>
                                                                            <option  value="<?php echo $_smarty_tpl->tpl_vars['client']->value->clientid;?>
" data-id="i<?php echo $_smarty_tpl->tpl_vars['client']->value->clientid;?>
" data-mobile="<?php echo $_smarty_tpl->tpl_vars['client']->value->clientmobile;?>
" data-phone="<?php echo $_smarty_tpl->tpl_vars['client']->value->clientphone;?>
" data-clientcode="<?php echo $_smarty_tpl->tpl_vars['client']->value->clientcode;?>
" <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesSupplier']->value==$_smarty_tpl->tpl_vars['client']->value->clientid){?> selected="selected" <?php }?>><?php echo $_smarty_tpl->tpl_vars['client']->value->clientname;?>
</option>
                                                                            <?php if ($_smarty_tpl->tpl_vars['client']->value->clientid==1){?>
                                                                            <option  value="-2"  class="newoption">اضافة عميل جديد</option>
                                                                            <?php }?>

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


                                                                        </select>-->
                                    <input type="hidden" name="supplier" id="supplier"
                                           class="select2Supp autoSaveBillMainPart" />
                                    <input type="hidden" id="oldsupplierid" value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->clientid;?>
" />
                                    <input type="hidden" id="oldsuppliername" value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->clientname;?>
" />
                                    <input type="hidden" id="initialSupp_PriceType"
                                           value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->priceTypeId;?>
" />
                                    <input type="hidden" id="initialSupp_Debt" value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->clientdebt;?>
" />

                                </div>
                                <span class="selectInvalidMsg">*</span>
                            </span> </div>

                        <input type="hidden" id="specialDiscount_" value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->specialDiscount;?>
" />
                        <input type="hidden" id="specialDiscountVal_" value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->specialDiscountVal;?>
" />
                    </div>
                    <!-- end of form-group-->

                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[56]->billsettingsvalue;?>
<?php $_tmp13=ob_get_clean();?><?php if ($_tmp13==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_DEBT_BALANCE;?>
</label>
                        <div class="col-lg-8 col-sm-8">
                            <p class="form-control-static" id="debt">0 </p>
                            <input name="hidden_debt" id="hidden_debt" type="hidden" value="0" />
                            <input id="hidden_debt_main_curr" type="hidden" value="0" />
                        </div>
                    </div>
                    <!-------------------------->
                    <?php }else{ ?>

                    <div class="form-group">
                        <label class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_CLIENT_NAME;?>
 </label>
                        <div class="col-lg-8 col-sm-8">
                            <span id="spryselect12">
                                <select multiple name="supplierX[]" id="supplier" class="select2 wdt100 multiSupp">


                                    <?php  $_smarty_tpl->tpl_vars['client'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['client']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['clientData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['client']->key => $_smarty_tpl->tpl_vars['client']->value){
$_smarty_tpl->tpl_vars['client']->_loop = true;
?>



                                    <option value="<?php echo $_smarty_tpl->tpl_vars['client']->value->clientid;?>
"><?php echo $_smarty_tpl->tpl_vars['client']->value->clientname;?>
</option>


                                    <?php } ?>
                                </select>
                                <span class="selectInvalidMsg">****.</span><span
                                    class="selectRequiredMsg">****.</span></span>
                        </div>
                    </div>

                    <input type="hidden" name="oldsupplierid" id="oldsupplierid" value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->clientid;?>
" />
                    <input type="hidden" name="oldsuppliername" id="oldsuppliername"
                           value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->clientname;?>
" />
                    <input type="hidden" id="initialSupp_PriceType" value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->priceTypeId;?>
" />
                    <input type="hidden" id="initialSupp_Debt" value="<?php echo $_smarty_tpl->tpl_vars['myclientdata']->value->clientdebt;?>
" />
                    <div class="form-group mg-bt5" style="display:none">
                        <label class="col-lg-4  col-sm-4 control-label"> <?php echo @SELL_BILL_DEBT_BALANCE;?>
</label>
                        <div class="col-lg-8 col-sm-8">
                            <p class="form-control-static" id="debt">0 </p>
                            <input name="hidden_debt" id="hidden_debt" type="hidden" value="0" />
                        </div>
                    </div>

                    <?php }?>

                    <div id="commentAZ" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[78]->billsettingsvalue;?>
<?php $_tmp14=ob_get_clean();?><?php if ($_tmp14==0){?> <?php }else{ ?> style="display:none"
                        <?php }?>>
                        <div class="form-group">
                            <label
                                class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_CLIENT_DETAILS;?>
</label>
                            <div class="col-lg-4 col-sm-8">

                            </div>
                        </div>

                    </div>

                    <!-- end of form-group-->

                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[68]->billsettingsvalue;?>
<?php $_tmp15=ob_get_clean();?><?php if ($_tmp15==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_PRICE_TYPE;?>
</label>
                        <div class="col-lg-8 col-sm-8">
                            <select class="select2 wdt100 autoSaveBillMainPart" name="pricetype" id="pricetype">
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
                                <option value="0" <?php if (($_smarty_tpl->tpl_vars['manyParcodes']->value!=1&&$_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==0)||($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==0)){?> selected="selected"
                                    <?php }?>><?php echo @SELL_BILL_WHOLESALE;?>
</option>
                                <?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
                                <option value="1" <?php if (($_smarty_tpl->tpl_vars['manyParcodes']->value!=1&&$_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==1)||($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==1)){?> selected="selected"
                                    <?php }?>><?php echo @SELL_BILL_RETAIL;?>
</option>
                                <?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
                                <option value="2" <?php if (($_smarty_tpl->tpl_vars['manyParcodes']->value!=1&&$_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==2)||($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==2)){?> selected="selected"
                                    <?php }?>><?php echo @SELL_BILL_HALF_WHOLESALE;?>
</option>
                                <?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
                                <option value="4" <?php if (($_smarty_tpl->tpl_vars['manyParcodes']->value!=1&&$_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==4)||($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==4)){?> selected="selected"
                                    <?php }?>><?php echo @SELL_BILL_PRICE4;?>
</option>
                                <?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
                                <option value="5" <?php if (($_smarty_tpl->tpl_vars['manyParcodes']->value!=1&&$_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==5)||($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==5)){?> selected="selected"
                                    <?php }?>><?php echo @SELL_BILL_PRICE5;?>
</option>
                                <?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
                                <option value="6" <?php if (($_smarty_tpl->tpl_vars['manyParcodes']->value!=1&&$_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==6)||($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==6)){?> selected="selected"
                                    <?php }?>><?php echo @SELL_BILL_PRICE6;?>
</option>
                                <?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
                                <option value="7" <?php if (($_smarty_tpl->tpl_vars['manyParcodes']->value!=1&&$_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==7)||($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==7)){?> selected="selected"
                                    <?php }?>><?php echo @SELL_BILL_PRICE7;?>
</option>
                                <?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
                                <option value="8" <?php if (($_smarty_tpl->tpl_vars['manyParcodes']->value!=1&&$_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==8)||($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==8)){?> selected="selected"
                                    <?php }?>><?php echo @SELL_BILL_PRICE8;?>
</option>
                                <?php }?>
                            </select>
                            <input type="hidden" name="hiddenpricetype" id="hiddenpricetype" value="0" />
                            <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value!=1){?>
                            <input type="hidden" id="hiddenpritype"
                                   value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue;?>
" />
                            <?php }else{ ?>
                            <input type="hidden" id="hiddenpritype" value="<?php echo $_smarty_tpl->tpl_vars['manyParcodesPriceType']->value;?>
" />
                            <?php }?>
                        </div>
                        <!----------------------------------------------------->
                        <div id="progressBarContainer" style="display: none;">
                            <div class="clearfix"></div>
                            <label class="col-lg-4 col-sm-4 control-label"></label>
                            <div class="col-lg-8 col-sm-8">
                                <div id="myProgress">
                                    <div id="myBar"></div>
                                </div>
                            </div>
                        </div>
                        <!----------------------------------------------------->
                    </div>
                    <!-- end of form-group-->

                    <hr class="mg-bt5 mg-tp5" />
                    <input type="hidden" id="userstoreid" value="<?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
" />
                    <input type="hidden" id="userstoreidForClient" value="<?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
" />
                    <div <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[2]->billsettingsvalue;?>
<?php $_tmp16=ob_get_clean();?><?php if ($_tmp16==0){?> <?php }else{ ?> style="display:none" <?php }?> >
                        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[26]->billsettingsvalue;?>
<?php $_tmp17=ob_get_clean();?><?php if ($_tmp17==1){?>

                        <!------ <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[2]->billsettingsvalue;?>
<?php $_tmp18=ob_get_clean();?><?php if ($_tmp18==0){?>  <?php }else{ ?> style="display:none" <?php }?>---------------------->
                        <div class="form-group mg-bt5">


                            <?php if ($_smarty_tpl->tpl_vars['userdata']->value->userstoreid==0){?>
                            <label class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_STORE;?>
</label>
                            <div class="col-lg-8 col-sm-8">
                                <select class="select2 wdt100 clientstore autoSaveBillMainPart" name="storeid"
                                        id="storeid">
                                    <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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 if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesStoreid']->value==$_smarty_tpl->tpl_vars['store']->value->storeId){?> selected="selected" <?php }?>><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
</option>

                                    <?php } ?>
                                </select>
                            </div>
                            <?php }else{ ?>

                            <div style="display:none">

                                <select class="select2 wdt100 clientstore autoSaveBillMainPart" name="storeid"
                                        id="storeid">
                                    <option value="-1"><?php echo @SELL_BILL_SELECT_STORE;?>
</option>

                                    <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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 <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp19=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
<?php $_tmp20=ob_get_clean();?><?php if ($_tmp19==$_tmp20){?> selected="selected"
                                        <?php }?>value="<?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
"><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
</option>


                                    <?php } ?>


                                </select>
                            </div>
                            <!--input name="storeid" id="storeid"  type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
" /-->
                            <label class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_STORE;?>
</label>
                            <div class="col-lg-8 col-sm-8 clientstoretxt">
                                <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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;
?>
                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp21=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
<?php $_tmp22=ob_get_clean();?><?php if ($_tmp21==$_tmp22){?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
 <?php }?>
                                <?php } ?>
                            </div>
                            <?php }?>

                        </div>
                        <?php }else{ ?>


                        <div style="display:none">
                            <select class="select2 wdt100 clientstore autoSaveBillMainPart" name="storeid" id="storeid">


                                <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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 <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp23=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
<?php $_tmp24=ob_get_clean();?><?php if ($_tmp23==$_tmp24){?> selected="selected"
                                    <?php }?>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>
                    <!-- end of form-group-->
                    <div <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[87]->billsettingsvalue;?>
<?php $_tmp25=ob_get_clean();?><?php if ($_tmp25==1){?> <?php }else{ ?> style="display:none" <?php }?> >
                        <div class="form-group mg-bt5">
                            <label class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_SAFE;?>
</label>
                            <div class="col-lg-8 col-sm-8">
                                <select class="select2 wdt100 autoSaveBillMainPart" name="saveid" id="saveid">
                                    <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allSaves']->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->saveid;?>
" data-curr=<?php echo $_smarty_tpl->tpl_vars['data']->value->currencyId;?>
 <?php if (($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&($_smarty_tpl->tpl_vars['mysellbilldata']->value->sellbillsaveid==$_smarty_tpl->tpl_vars['data']->value->saveid||$_smarty_tpl->tpl_vars['mysellbilldata']->value->returnsellbillsaveid==$_smarty_tpl->tpl_vars['data']->value->saveid||$_smarty_tpl->tpl_vars['manyParcodesSaveid']->value==$_smarty_tpl->tpl_vars['data']->value->saveid))||($_smarty_tpl->tpl_vars['manyParcodes']->value!=1&&$_smarty_tpl->tpl_vars['sessionSave']->value==$_smarty_tpl->tpl_vars['data']->value->saveid)){?> selected="selected" <?php }?>><?php echo $_smarty_tpl->tpl_vars['data']->value->savename;?>

                                    </option>

                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <div class="form-group mg-bt5" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showCurrency!=1){?>style="display:none;"<?php }?>>
                        <label class="col-lg-4 control-label">العملة</label>
                        <div class="col-lg-8">
                            <select class="select2" name="currencyId" id="currencyId">
                                <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allCurrency']->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->id;?>
" data-cfactor="<?php echo $_smarty_tpl->tpl_vars['data']->value->conversionFactor;?>
"
                                        data-othercfactor="<?php echo $_smarty_tpl->tpl_vars['data']->value->otherconversionFactor;?>
"><?php echo $_smarty_tpl->tpl_vars['data']->value->name;?>
</option>
                                <?php } ?>
                            </select>
                        </div>
                        <div class="clear"></div>
                        <label class="col-lg-4 control-label">معامل التحويل</label>
                        <div class="col-lg-8">
                            <input type="text" name="cFactor" id="cFactor" class="form-control positivefloat calcOther"
                                   onkeyup="populateDebtAfter();" style="display: inline-block;width: 34%" />
                            =
                            <div class="input-group" style="display: inline;">
                                <input type="text" name="otherCFactor" id="otherCFactor"
                                       class="form-control positivefloat calcOther"
                                       style="display: inline-block;width: 34%" />
                                <span class="input-group-addon"
                                      style="display: inline-block;width: 23%"><?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</span>
                            </div>
                        </div>
                    </div>

                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[3]->billsettingsvalue;?>
<?php $_tmp26=ob_get_clean();?><?php if ($_tmp26==0){?>
                        style="display:block" <?php }else{ ?> style="display:none" <?php }?>>
                        <label class="col-lg-4 col-sm-4 control-label"> اسم <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==0){?> بائع <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==1){?>مندوب <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==2){?>طبيب <?php }?></label>
                        <div class="col-lg-8 col-sm-8">
                            <select class="select2 wdt100 autoSaveBillMainPart" name="sellerid" id="sellerid">

                                <option value="-1"><?php echo @SELL_BILL_SELECT;?>
</option>
                                <?php  $_smarty_tpl->tpl_vars['seller'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['seller']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['sellerData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['seller']->key => $_smarty_tpl->tpl_vars['seller']->value){
$_smarty_tpl->tpl_vars['seller']->_loop = true;
?>


                                <option value="<?php echo $_smarty_tpl->tpl_vars['seller']->value->userid;?>
" <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['manyParcodesSellerid']->value==$_smarty_tpl->tpl_vars['seller']->value->userid){?> selected="selected" <?php }?>><?php echo $_smarty_tpl->tpl_vars['seller']->value->employeename;?>
</option>


                                <?php } ?>


                            </select>
                        </div>
                    </div>
                    <!-- end of form-group-->

                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[101]->billsettingsvalue;?>
<?php $_tmp27=ob_get_clean();?><?php if ($_tmp27==0){?>
                        style="display:block" <?php }else{ ?> style="display:none" <?php }?>>
                        <label class="col-lg-4 control-label">عملية الفاتورة</label>
                        <div class="col-lg-8">
                            <select class="select2 wdt100" name="billoperationid" id="billoperationid">
                                <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['billOperations']->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->id;?>
" <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['addManyParcodebilloperationid']->value==$_smarty_tpl->tpl_vars['data']->value->id){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['data']->value->name;?>
</option>
                                <?php } ?>
                            </select>
                        </div>
                    </div>
                    <!-- end of form-group-->

                    <div class="form-group mg-bt5" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[101]->billsettingsvalue==0){?> <?php }else{ ?>
                        style="display:none !important;" <?php }?>>
                        <label class="col-lg-4 control-label">نوع الفاتورة</label>
                        <div class="col-lg-8">
                            <div class="radio-inline">
                                <label>
                                    <input value="1" class="radioR" name="obgyBillType" type="radio" <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['addManyParcodeobgyBillType']->value==1){?>checked<?php }?>>
                                    مباشر</label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="2" class="radioR" name="obgyBillType" type="radio" <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['addManyParcodeobgyBillType']->value==2){?>checked<?php }?>>
                                    مستهلك</label>
                            </div>
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <div class="form-group mg-bt5" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[12]->billsettingsvalue==0){?> <?php }else{ ?>
                        style="display:none !important;" <?php }?>>
                        <label class="col-lg-4 control-label"><?php echo @SELL_BILL_COMMENT;?>
</label>
                        <div class="col-lg-8">
                            <textarea name="comment" id="comment" cols="" rows=""
                                      class="form-control autoSaveBillMainPart" tabindex="6"></textarea>
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[109]->billsettingsvalue;?>
<?php $_tmp28=ob_get_clean();?><?php if ($_tmp28==0){?>
                    <div class="form-group mg-bt5">
                        <label class="col-lg-4 col-sm-4 control-label"><?php echo @SELL_BILL_KNOW_WAY;?>
</label>
                        <div class="col-lg-8 col-sm-8">
                            <select class=" wdt100" name="knownwayId" id="know_way">
                                <option value=""><?php echo @SELL_BILL_SELECT;?>
</option>
                                <?php  $_smarty_tpl->tpl_vars['way'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['way']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['knownWays']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['way']->key => $_smarty_tpl->tpl_vars['way']->value){
$_smarty_tpl->tpl_vars['way']->_loop = true;
?>
                                <option value="<?php echo $_smarty_tpl->tpl_vars['way']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['way']->value->name;?>
</option>
                                <?php } ?>
                            </select>
                        </div>
                    </div>
                    <?php }?>
                    <!-- end of form-group-->
                </div>

                <!-- end of client info-->

            </div>

            <!-- end of frist row-->
            <!-- hidden ===============================-->
            <input type="hidden" id="newproductItr" />
            <input type="hidden" id="newproductTabIndex" />
            <input type="hidden" name="billnameid" id="billnameid" value="<?php echo $_smarty_tpl->tpl_vars['billnameid']->value;?>
" />
            <input type="hidden" id="settingreturn" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[0]->billsettingsvalue;?>
" />
            <input type="hidden" name="settingclient" id="settingclient"
                   value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[1]->billsettingsvalue;?>
" />
            <input type="hidden" name="settingstore" id="settingstore"
                   value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[2]->billsettingsvalue;?>
" />
            <input type="hidden" name="settingseller" id="settingseller"
                   value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[3]->billsettingsvalue;?>
" />
            <input type="hidden" id="settingparcode" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[4]->billsettingsvalue;?>
" />
            <input type="hidden" name="settingdate" id="settingdate"
                   value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[5]->billsettingsvalue;?>
" />
            <input type="hidden" id="settingnewproduct" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[6]->billsettingsvalue;?>
" />
            <input type="hidden" id="settingcomment" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[7]->billsettingsvalue;?>
" />
            <input type="hidden" id="settingdiscount" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
" />
            <input type="hidden" id="settingQuantitiyFocus" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[9]->billsettingsvalue;?>
" />
            <input type="hidden" id="settingUnit" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[10]->billsettingsvalue;?>
" />
            <input type="hidden" name="settingQuantityAlert" id="settingQuantityAlert"
                   value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[13]->billsettingsvalue;?>
" />


            <input type="hidden" id="morestore" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[26]->billsettingsvalue;?>
" />
            <input type="hidden" id="sumSameProductForStore" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[73]->billsettingsvalue;?>
" />
            <input type="hidden" id="usePriceTypeOfClient" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[74]->billsettingsvalue;?>
" />
            <input type="hidden" name="saveBtnGoesTo" id="saveBtnGoesTo"
                   value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[75]->billsettingsvalue;?>
" />
            <input type="hidden" id="userSaveCurrencyName" value="<?php echo $_smarty_tpl->tpl_vars['userSaveData']->value->currencyName;?>
" />
            <input type="hidden" id="userSaveconversionFactor" value="<?php echo $_smarty_tpl->tpl_vars['userSaveData']->value->conversionFactor;?>
" />
            <input type="hidden" id="oldCFactor" value="0" />
            <input type="hidden" id="sellerIsRequired" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[76]->billsettingsvalue;?>
" />

            <input type="hidden" id="searchvalue" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->searchvalue;?>
" />
            <input type="hidden" id="directDiscount" value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->directDiscount;?>
" />
            <input type="hidden" id="percentageDiscount" value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->percentageDiscount;?>
" />
            <input type="hidden" id="priceupdate" value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->priceupdate;?>
" />

            <input type="hidden" name="ordertype" id="ordertype" value="<?php echo $_smarty_tpl->tpl_vars['billnameData']->value->ordertype;?>
" />
            <input type="hidden" name="offerId" id="offerId" value="<?php echo $_smarty_tpl->tpl_vars['offerId']->value;?>
" />
            <input type="hidden" name="sellbilldiscount" id="sellbilldiscount"
                   value="<?php echo $_smarty_tpl->tpl_vars['mysellbilldata']->value->sellbilldiscount;?>
" />
            <input type="hidden" id="extraDiscountPlace" value="<?php echo $_smarty_tpl->tpl_vars['billnameData']->value->extraDiscountPlace;?>
" />
            <input type="hidden" id="useExtraDiscount" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[90]->billsettingsvalue;?>
" />
            <input type="hidden" id="saveeffect" value="<?php echo $_smarty_tpl->tpl_vars['billnameData']->value->saveeffect;?>
" />
            <input type="hidden" id="discountrowtype" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue;?>
" />
            <input type="hidden" id="multiclient" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[37]->billsettingsvalue;?>
" />
            <input type="hidden" name="isTaxBill" id="isTaxBill" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[92]->billsettingsvalue;?>
" />
            <input type="hidden" name="taxBillNumber" id="taxBillNumber" value="<?php echo $_smarty_tpl->tpl_vars['nextId']->value;?>
" />


            <input type="hidden" id="showdiscountrow" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
" />

            <input type="hidden" id="showbouns" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[38]->billsettingsvalue;?>
" />
            <input type="hidden" id="showclientdetail" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[39]->billsettingsvalue;?>
" />
            <input type="hidden" id="showCommentAZ" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[78]->billsettingsvalue;?>
" />
            <input type="hidden" id="showtotal" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[41]->billsettingsvalue;?>
" />
            <input type="hidden" id="shownumber" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[40]->billsettingsvalue;?>
" />
            <input type="hidden" id="payedSetting" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[71]->billsettingsvalue;?>
" />
            <input type="hidden" id="manyParcodesVal_h" value="<?php echo $_smarty_tpl->tpl_vars['manyParcodes']->value;?>
" />
            <input type="hidden" id="showrowPriceType" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[83]->billsettingsvalue;?>
" />
            <input type="hidden" id="ebillclient" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->ebillclient;?>
" />


            <!-- end of hidden ===============================-->


            <div class="" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[14]->billsettingsvalue;?>
<?php $_tmp29=ob_get_clean();?><?php if ($_tmp29==0){?> <?php }else{ ?> style="display:none !important"
                <?php }?>>
                <div class="row mobile-p">
                    <hr />
                    <div class="col-lg-6 col-sm-4">
                        <h4 id="header4Sell"><?php echo @SELL_BILL_SALES_INVOICE;?>
</h4>
                    </div>
                    <div class="col-lg-6 col-sm-8">
                        <button type="button" name="addpro" id="addpro"
                                class="btn btn-primary pull-left ft-nor"><?php echo @SELL_BILL_ADD_NEW;?>
 </button>



                        <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value!=1){?>
                        <button type="button" class="btn btn-success pull-left ft-nor addManyParcodes" data-type="sell"
                                style="margin-left:3px;"><?php echo @SELL_BILL_COMBINED_BARCODE;?>
 </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>
                <!-- end of title row-->
                <div class="table-responsive bd-gr" id="taxesitr">
                    <table class="table billtable table-bordered  table-black" id="containerpros">
                        <thead>
                            <tr>

                                <th class="wdt20" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[6]->billsettingsvalue;?>
<?php $_tmp30=ob_get_clean();?><?php if ($_tmp30==0){?> <?php }else{ ?>
                                    style="display:none !important;" <?php }?>><?php echo @SELL_BILL_NEW;?>
</th>

                                <th class="wdt20" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[40]->billsettingsvalue;?>
<?php $_tmp31=ob_get_clean();?><?php if ($_tmp31==0){?> <?php }else{ ?>
                                    style="display:none !important;" <?php }?>><?php echo @SELL_BILL_NUMBER;?>
</th>
                                <th
                                    class="wdt20 <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[104]->billsettingsvalue;?>
<?php $_tmp32=ob_get_clean();?><?php if ($_tmp32==0){?> proSellTrackingSerialClass <?php }else{ ?> hidden <?php }?>">
                                    Serial</th><!--السيريال الثانوى-->

                                <th
                                    class="wdt120 check_tr_parcode <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[59]->billsettingsvalue;?>
<?php $_tmp33=ob_get_clean();?><?php if ($_tmp33==1){?> hidden <?php }?>">
                                    <?php echo @SELL_BILL_BARCODE;?>
</th>
                                <th <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[26]->billsettingsvalue;?>
<?php $_tmp34=ob_get_clean();?><?php if ($_tmp34==0){?> <?php }else{ ?> style="display:none
                                    !important;" <?php }?> class="wdt300" ><?php echo @SELL_BILL_STORE;?>
</th>
                                <th class="wdt400"><?php echo @SELL_BILL_PRODUCT_NAME;?>
</th>
                                <th <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[7]->billsettingsvalue;?>
<?php $_tmp35=ob_get_clean();?><?php if ($_tmp35==0){?> <?php }else{ ?> style="display:none
                                    !important" <?php }?> class="wdt240"><?php echo @SELL_BILL_NOTES;?>
</th>
                                <th
                                    class="wdt100n check_tr_unit <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[53]->billsettingsvalue;?>
<?php $_tmp36=ob_get_clean();?><?php if ($_tmp36==1){?>  hidden <?php }?>">
                                    <?php echo @SELL_BILL_UNIT;?>
</th>
                                <th
                                    class="wdt100n check_tr_Height <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp37=ob_get_clean();?><?php if ($_tmp37==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    الطول</th>
                                <th
                                    class="wdt100n check_tr_Width <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp38=ob_get_clean();?><?php if ($_tmp38==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    العرض</th>
                                <th
                                    class="wdt100n check_tr_quantity <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp39=ob_get_clean();?><?php if ($_tmp39==1){?>  hidden <?php }?>">
                                    <?php echo @SELL_BILL_QUANTITY;?>
</th>
                                <th class="wdt100n   <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->scunitname;?>
<?php $_tmp40=ob_get_clean();?><?php if ($_tmp40=='0'){?>  hidden <?php }?>">
                                    <?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->scunitname;?>
</th>

                                <th class="wdt20" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[38]->billsettingsvalue;?>
<?php $_tmp41=ob_get_clean();?><?php if ($_tmp41==0){?> <?php }else{ ?>
                                    style="display:none !important;" <?php }?>>Bouns</th>
                                <th
                                    class="wdt80 showrowPriceType <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[83]->billsettingsvalue;?>
<?php $_tmp42=ob_get_clean();?><?php if ($_tmp42==1){?>  <?php }else{ ?> hidden <?php }?>">
                                    <?php echo @SELL_BILL_PRICE_TYPE;?>
</th>
                                <th class="wdt80 <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <?php echo @SELL_BILL_PRICE;?>
</th>

                                <th
                                    class="wdt100n check_tr_disco8unt <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
<?php $_tmp43=ob_get_clean();?><?php if ($_tmp43==1){?>  hidden <?php }?>">
                                    <?php echo @SELL_BILL_DISCOUNT;?>
</th>




                                <!-------------------------------------discountvalue by hazem---------------------------------------------->
                                <!--th <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
<?php $_tmp44=ob_get_clean();?><?php if ($_tmp44==0){?>  <?php }else{ ?> style="display:none !important" <?php }?> class="wdt80"> نسبة الخصم</th-->
                                <!-------------------------------------discountvalue by hazem---------------------------------------------->
                                <th class="wdt100n <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <input name="hidden_itr" id="hidden_itr" type="hidden"
                                           value="<?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['detalesitr']->value>0){?><?php echo $_smarty_tpl->tpl_vars['detalesitr']->value;?>
<?php }else{ ?>1<?php }?>" />
                                    <?php echo @SELL_BILL_TOTAL;?>

                                </th>
                                <th
                                    class="check_tr_soldSerials <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->expiredate;?>
<?php $_tmp45=ob_get_clean();?><?php if ($_tmp45==1){?>  hidden <?php }?>">
                                    سريل</th>


                                <th class="<?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->ebillclient==0){?>  hidden <?php }?>">
                                    ض
                                </th>

                                <th><?php echo @SELL_BILL_DELETE;?>
</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['detalesitr']->value>0){?>


                            <?php $_smarty_tpl->tpl_vars['x'] = new Smarty_variable(1, null, 0);?>
                            <?php  $_smarty_tpl->tpl_vars['mymysellbildetales'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['mymysellbildetales']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['mysellbildetales']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['mymysellbildetales']->key => $_smarty_tpl->tpl_vars['mymysellbildetales']->value){
$_smarty_tpl->tpl_vars['mymysellbildetales']->_loop = true;
?>

                            <tr id="productraw1">
                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[6]->billsettingsvalue;?>
<?php $_tmp46=ob_get_clean();?><?php if ($_tmp46==0){?> <?php }else{ ?> style="display:none
                                    !important;" <?php }?>><a onClick="javascript:showProductModal(<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
, 7);"
                                                          class="newLink btn btn-primary btn-xs conformdelProduct">جديد</a></td>

                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[40]->billsettingsvalue;?>
<?php $_tmp47=ob_get_clean();?><?php if ($_tmp47==0){?> <?php }else{ ?> style="display:none
                                    !important;" <?php }?>><span class="proDetails" data-pro="product<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['x']->value;?>
</span></td>

                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[104]->billsettingsvalue;?>
<?php $_tmp48=ob_get_clean();?><?php if ($_tmp48==0){?> <?php }else{ ?> style="display:none
                                    !important;" <?php }?>>
                                    <input type="text" name="proSellTrackingSerial<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="proSellTrackingSerial<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                           class="form-control txt-nonraduis autoSaveBillRow" tabindex="7" size="3" />
                                </td>
                                <td
                                    class="wdt120 check_tr_parcode <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[59]->billsettingsvalue;?>
<?php $_tmp49=ob_get_clean();?><?php if ($_tmp49==1){?>  hidden <?php }?>">
                                    <div id="productparcode<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                        <input type="text" name="parcode<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="parcode<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                               value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->parcode;?>
"
                                               class="form-control txt-nonraduis autoSaveBillRow" tabindex="7"
                                               onkeypress="getproductbyParcode(event, this.value, <?php echo $_smarty_tpl->tpl_vars['x']->value;?>
);" size="3"
                                               placeholder="الباركود" />
                                        <input name="parcodeType<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="parcodeType<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" type="hidden" />
                                        <input name="productserailid<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="productserailid<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" type="hidden" />
                                        <input name="productQty<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="productQty<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" type="hidden" />
                                    </div>
                                </td>

                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[26]->billsettingsvalue;?>
<?php $_tmp50=ob_get_clean();?><?php if ($_tmp50==0){?> <?php }else{ ?> style="display:none
                                    !important" <?php }?>>
                                    <div id="prstoridsiv<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">

                                        <?php if ($_smarty_tpl->tpl_vars['userdata']->value->userstoreid==0){?>
                                        <select class="select2 clientstore wdt100 autoSaveBillRow" name="prstorid<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                                id="prstorid<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                            <option value="-1"><?php echo @SELL_BILL_SELECT_STORE;?>
</option>
                                            <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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 <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->storeid;?>
<?php $_tmp51=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp52=ob_get_clean();?><?php if ($_tmp51==$_tmp52){?>
                                                selected="selected" <?php }?>value="<?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
"><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>

                                            </option>
                                            <?php } ?>
                                        </select>
                                        <?php }else{ ?>
                                        <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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;
?>
                                        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp53=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
<?php $_tmp54=ob_get_clean();?><?php if ($_tmp53==$_tmp54){?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
 <?php }?>
                                        <?php } ?>
                                        <input name="prstorid<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="prstorid<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" class="selectstore" type="hidden"
                                               value="<?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
" />
                                        <?php }?>
                                    </div>
                                </td>
                                <td>

                                    <div id="productdiv<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                        <input type="hidden" id="product<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" name="product<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                               class="select2product wdt100 autoSaveBillRow" tabindex="7" />

                                        <input type="hidden" id="oldproduct<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" name="oldproduct<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                               value="<?php if ($_smarty_tpl->tpl_vars['mymysellbildetales']->value->sizeid>0&&$_smarty_tpl->tpl_vars['mymysellbildetales']->value->colorid>0){?>hasSizeColor<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailproductid;?>
-<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sizeid;?>
-<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->colorid;?>
<?php }else{ ?><?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailproductid;?>
<?php }?>" />
                                        <input type="hidden" id="oldname<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" name="oldname<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                               value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->productName;?>

                                               <?php if ($_smarty_tpl->tpl_vars['mymysellbildetales']->value->sizeName!=''){?>/ <?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sizeName;?>
<?php }?>
                                               <?php if ($_smarty_tpl->tpl_vars['mymysellbildetales']->value->colorName!=''){?>/ <?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->colorName;?>
<?php }?>" />

                                    </div>
                                </td>
                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[7]->billsettingsvalue;?>
<?php $_tmp55=ob_get_clean();?><?php if ($_tmp55==0){?> <?php }else{ ?> style="display:none
                                    !important" <?php }?>>
                                    <textarea class="form-control txt-nonraduis enteraction autoSaveBillRow"
                                              name="comment<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="comment<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" rows="1"
                                              tabindex="7"><?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->note;?>
</textarea>
                                </td>
                                <td
                                    class="wdt100n check_tr_unit <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[53]->billsettingsvalue;?>
<?php $_tmp56=ob_get_clean();?><?php if ($_tmp56==1){?>  hidden <?php }?>">
                                    <div id="productunitdiv<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                        <input type="hidden" name="proNum<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="proNum<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" value="" />
                                        <select id="productunit<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" name="productunit<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                                class="select2 wdt100 autoSaveBillRow" tabindex="7"
                                                onChange="getunitprice(<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
);">
                                            <option value="-1"></option>
                                            <?php  $_smarty_tpl->tpl_vars['mymyunitdata'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['mymyunitdata']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['myunitdata'.($_smarty_tpl->tpl_vars['x']->value)]->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['mymyunitdata']->key => $_smarty_tpl->tpl_vars['mymyunitdata']->value){
$_smarty_tpl->tpl_vars['mymyunitdata']->_loop = true;
?>
                                            <option data-pu-num="<?php echo $_smarty_tpl->tpl_vars['mymyunitdata']->value->productnumber;?>
" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->productunitid;?>
<?php $_tmp57=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['mymyunitdata']->value->productunitid;?>
<?php $_tmp58=ob_get_clean();?><?php if ($_tmp57==$_tmp58){?>
                                                selected="selected" <?php }?> value="<?php echo $_smarty_tpl->tpl_vars['mymyunitdata']->value->productunitid;?>
"
                                                ><?php echo $_smarty_tpl->tpl_vars['mymyunitdata']->value->unitName;?>
</option>
                                            <?php } ?>
                                        </select>
                                    </div>
                                </td>
                                <td
                                    class="wdt100n check_tr_Height <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp59=ob_get_clean();?><?php if ($_tmp59==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    <input type="text" name="proHeight<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="proHeight<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                           value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->proHeight;?>
"
                                           class="form-control txt-nonraduis enteraction numberinput positivefloat autoSaveBillRow"
                                           onKeyUp="calcQuantity(<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
, event);" tabindex="7" />
                                </td>
                                <td
                                    class="wdt100n check_tr_Width <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp60=ob_get_clean();?><?php if ($_tmp60==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    <input type="text" name="proWidth<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="proWidth<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                           value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->proWidth;?>
"
                                           class="form-control txt-nonraduis enteraction numberinput positivefloat autoSaveBillRow"
                                           onKeyUp="calcQuantity(<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
, event);" tabindex="7" />
                                </td>
                                <td
                                    class="wdt100n check_tr_quantity <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp61=ob_get_clean();?><?php if ($_tmp61==1){?>  hidden <?php }?>">
                                    <input type="text" name="pronum<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="pronum<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                           value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailquantity;?>
"
                                           class="form-control txt-nonraduis getprototal enteraction numberinput positivefloat autoSaveBillRow"
                                           onKeyUp="checkquantity(<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
, event);" value="1" tabindex="7" />
                                </td>
                                <td class="  <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->scunitname;?>
<?php $_tmp62=ob_get_clean();?><?php if ($_tmp62=='0'){?>  hidden <?php }?>">
                                    <input name="scunitname<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="scunitname<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                           value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->otherdetailquantity;?>
"
                                           class="form-control txt-nonraduis positiveNo autoSaveBillRow"
                                           placeholder="<?php echo @SELL_BILL_QUANTITY;?>
" type="text" tabindex="7" />
                                </td>

                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[38]->billsettingsvalue;?>
<?php $_tmp63=ob_get_clean();?><?php if ($_tmp63==0){?> <?php }else{ ?> style="display:none
                                    !important" <?php }?>>
                                    <input type="text" name="bouns<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="bouns<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                           class="form-control txt-nonraduis getprototal enteraction numberinput autoSaveBillRow"
                                           value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->bouns;?>
" tabindex="7" />
                                </td>
                                <td
                                    class="showrowPriceType <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[83]->billsettingsvalue;?>
<?php $_tmp64=ob_get_clean();?><?php if ($_tmp64==1){?>  <?php }else{ ?> hidden <?php }?>">
                                    <select class="select2 wdt100 autoSaveBillRow" name="pricetypepro<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                            id="pricetypepro<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
                                        <option value="0" <?php if ($_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==0){?> selected="selected" <?php }?>>
                                            <?php echo @SELL_BILL_WHOLESALE;?>
</option><?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
                                        <option value="1" <?php if ($_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==1){?> selected="selected" <?php }?>>
                                            <?php echo @SELL_BILL_RETAIL;?>
</option><?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
                                        <option value="2" <?php if ($_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==2){?> selected="selected" <?php }?>>
                                            <?php echo @SELL_BILL_HALF_WHOLESALE;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
                                        <option value="4" <?php if ($_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==4){?> selected="selected" <?php }?>>
                                            <?php echo @SELL_BILL_PRICE4;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
                                        <option value="5" <?php if ($_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==5){?> selected="selected" <?php }?>>
                                            <?php echo @SELL_BILL_PRICE5;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
                                        <option value="6" <?php if ($_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==6){?> selected="selected" <?php }?>>
                                            <?php echo @SELL_BILL_PRICE6;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
                                        <option value="7" <?php if ($_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==7){?> selected="selected" <?php }?>>
                                            <?php echo @SELL_BILL_PRICE7;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
                                        <option value="8" <?php if ($_smarty_tpl->tpl_vars['manyParcodesPriceType']->value==8){?> selected="selected" <?php }?>>
                                            <?php echo @SELL_BILL_PRICE8;?>
</option>
                                        <?php }?>
                                    </select>
                                </td>
                                <td class=" <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?> ">
                                    <div id="propricechange<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                        <input type="text" name="proprice<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="proprice<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                               value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailprice;?>
"
                                               class="form-control getprototal enteraction numberinput txt-nonraduis positivefloat autoSaveBillRow"
                                               value="0" tabindex="7" <?php if ($_smarty_tpl->tpl_vars['mymysellbildetales']->value->background!=''){?>style="background-color:<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->background;?>
"<?php }?>/>
                                    </div>
                                </td>


                                <td
                                    class="check_tr_discount <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
<?php $_tmp65=ob_get_clean();?><?php if ($_tmp65==1){?>  hidden <?php }?>">
                                    <!--input type="text" name="prodis<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="prodis<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"   class="form-control txt-nonraduis getprototal enteraction numberinput" value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->discountvalue;?>
" tabindex="7"  /-->

                                    <div class="input-group">

                                        <input name="prodis<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="prodis<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" class="form-control txt-nonraduis getprototal enteraction numberinput positiveNo autoSaveBillRow
                                               <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue==1){?> hidden <?php }?>"
                                               value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->discountvalue;?>
" tabindex="7" type="text" />
                                        <input name="discounttype<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="discounttype<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" class="form-control txt-nonraduis getprototal enteraction numberinput positivefloat autoSaveBillRow
                                               <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue==0){?> hidden <?php }?>"
                                               value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->discounttype;?>
" tabindex="7" type="text" />

                                        <span class="input-group-addon small-addon discountSpan" data-itr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue;?>
<?php $_tmp66=ob_get_clean();?><?php if ($_tmp66==0){?>C
                                            <?php }else{ ?>
                                            %
                                            <?php }?>
                                        </span>
                                    </div>
                                </td>
                                <!-------------------------------------discountvalue by hazem---------------------------------------------->
                                <!--td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
<?php $_tmp67=ob_get_clean();?><?php if ($_tmp67==0){?>  <?php }else{ ?> style="display:none !important" <?php }?>>
                                  <input type="text" name="prodisper<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="prodisper<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"  onkeyup="getdiscount(<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
);"  class="form-control txt-nonraduis  enteraction numberinput " value="0" tabindex="7"  />
                                </td-->
                                <!-------------------------------------discountvalue by hazem---------------------------------------------->
                                <td class="<?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <div id="prototal<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" class="form-control-static">
                                        <?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailtotalprice;?>
</div>
                                    <input name="hidden_prototal<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="hidden_prototal<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                           value="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailtotalprice;?>
" type="hidden"
                                           value="0" />
                                </td>
                                <td class="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->expiredate;?>
<?php $_tmp68=ob_get_clean();?><?php if ($_tmp68==1){?>  hidden <?php }?>">
                                    <input type="hidden" name="proSerials<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="proSerials<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                           class="autoSaveBillRow" value="">
                                    <input type='hidden' id='oldproSerials<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
'
                                           value='<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->soldSerialsInDetails;?>
' />
                                </td>
                                <td class="<?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->ebillclient==0){?>  hidden <?php }?>">

                                    <button type="button" class="btn btn-primary Taxes" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                            data-toggle="modal" data-whatever="@mdo"></button>

                                </td>
                                <?php ob_start();?><?php echo count($_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailtax);?>
<?php $_tmp69=ob_get_clean();?><?php if ($_tmp69<1){?> <div class="modal fade"
                                                                                      id="ebillclient<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" role="dialog" aria-labelledby="exampleModalLabel"
                                                                                      aria-hidden="true">
                            <div class="modal-dialog modal-lg" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close pull-left" data-dismiss="modal"
                                                aria-hidden="true">×</button>
                                    </div>
                                    <div class="modal-body">
                                        <div style="display: none">
                                            <button type="button"
                                                    class="btn green-meadow btn-sm pull-right addtaxes"
                                                    id="addtaxes<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" style="background: #55ff55">
                                                اضافه ضريبه </button>
                                            <button type="button" style="background: #f34141"
                                                    class="btn green-meadow btn-sm pull-right removetaxes"
                                                    id="removetaxes" data-edit='0' data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"> حذف </button>
                                            <input type="hidden" id="taxesitr_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                                   name="taxesitr_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" value="1">
                                        </div>
                                        <div style="clear: both;"></div>

                                        <ul id="taxes<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                            <li id="litaxes_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_1">
                                                <div style="    width: 20% !important;float: right;">
                                                    <input type="hidden" name="type_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_1" class="eTaxType"
                                                           id="eTaxType_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_1" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" data-itr="1">
                                                </div>
                                                <div style="    width: 20% !important;float: right;">
                                                    <input type="hidden" name="subtype_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_1"
                                                           id="eTaxsubtype_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_1" class="eTaxsubtype" data-itr="1"
                                                           data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                                </div>
                                                <div style=" width: 20% !important;float: right;">
                                                    <input type="text" name="rate_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_1"
                                                           class="form-control must_go_req ncloseebill rates rate_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                                           id="rate_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_1" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" data-itr="1"
                                                           placeholder="نسبه">
                                                </div>
                                                <div style="width: 20% !important;float: right;">
                                                    <input type="text" name="amount_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_1" class="form-control must_go_req ncloseebill
                                                           amounts  amount_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="amount_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_1" data-itr="1"
                                                           data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" placeholder="المبلغ">
                                                </div>
                                                <div style="width: 20% !important;float: right;">
                                                    <!--<button type="button"  style="background: #f34141" class="btn green-meadow btn-sm pull-right  removeellbilldetailtax" data-edit='0'  data-itr="1" data-mitr="1"> x </button>-->
                                                </div>
                                            </li>
                                            <div style="clear: both;"></div>
                                        </ul>
                                    </div>
                                    <div style="clear: both;"></div>
                                    <div class="modal-footer" style="text-align: center !important">
                                        <button type="button" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                                style="opacity: 1;background: blue" class="close closeebill"
                                                data-dismiss="modal" aria-hidden="true">اعتماد</button>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <?php }else{ ?>
                        <div class="modal fade" id="ebillclient<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" role="dialog" aria-labelledby="exampleModalLabel"
                             aria-hidden="true">
                            <div class="modal-dialog modal-lg" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close pull-left" data-dismiss="modal"
                                                aria-hidden="true">×</button>
                                    </div>
                                    <div class="modal-body">
                                        <div style="display: none">
                                            <button type="button" class="btn green-meadow btn-sm pull-right addtaxes"
                                                    id="addtaxes<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" style="background: #55ff55"> اضافه ضريبه
                                            </button>
                                            <button type="button" style="background: #f34141"
                                                    class="btn green-meadow btn-sm pull-right removetaxes" data-edit='1'
                                                    data-id="<?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailid;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"> حذف </button>
                                            <input type="hidden" id="taxesitr_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" name="taxesitr_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                                   value="<?php echo count($_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailtax);?>
">
                                        </div>
                                        <div style="clear: both;"></div>

                                        <ul id="taxes<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
">
                                            <?php $_smarty_tpl->tpl_vars['ex'] = new Smarty_variable(1, null, 0);?>
                                            <?php  $_smarty_tpl->tpl_vars['sellbilldetailtax'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['sellbilldetailtax']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailtax; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['sellbilldetailtax']->key => $_smarty_tpl->tpl_vars['sellbilldetailtax']->value){
$_smarty_tpl->tpl_vars['sellbilldetailtax']->_loop = true;
?>
                                            <li id="litaxes_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
">
                                                <input type="hidden" name="sellbilldetailtaxid_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
"
                                                       value="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->id;?>
">

                                                <div style="    width: 20% !important;float: right;">
                                                    <input type="hidden" name="type_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" class="eTaxType"
                                                           id="eTaxType_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
"
                                                           value="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->type;?>
">
                                                    <input type="hidden" class="oldtype<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
"
                                                           data-text="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->type;?>
"
                                                           data-id="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->type;?>
"
                                                           data-stext="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->subtype;?>
"
                                                           data-sid="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->subtype;?>
">
                                                </div>

                                                <div style="    width: 20% !important;float: right;">
                                                    <input type="hidden" name="subtype_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" class="eTaxsubtype"
                                                           id="eTaxsubtype_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
"
                                                           value="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->subtype;?>
">
                                                </div>

                                                <div style="    width: 20% !important;float: right;">
                                                    <input type="text" name="rate_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
"
                                                           class="form-control must_go_req ncloseebill rates rate_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                                           data-itrolddddddddddddddddddddddddd="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" id="rate_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
"
                                                           data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" placeholder="نسبه"
                                                           value="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->rate;?>
">
                                                </div>

                                                <div style="    width: 20% !important;float: right;">
                                                    <input type="text" name="amount_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" class="form-control must_go_req ncloseebill
                                                           amounts  amount_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                                           data-itrolddddddddddddddddddddddddddd="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                                           data-itr="<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" id="amount_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" placeholder="المبلغ"
                                                           value="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->amount;?>
">
                                                </div>

                                                <div style="    width: 20% !important;float: right;">
                                                    <!--<button type="button"  style="background: #f34141" class="btn green-meadow btn-sm pull-right removeellbilldetailtax" id="removetaxes" data-edit='1' data-id="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->id;?>
" data-itroldddddddddddddddd="<?php echo $_smarty_tpl->tpl_vars['sellbilldetailtax']->value->id;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['ex']->value;?>
" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"> x </button>-->
                                                </div>
                                            </li>
                                            <div style="clear: both;"></div>
                                            <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'ex', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['ex']->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 } ?>

                                        </ul>
                                    </div>
                                    <div style="clear: both;"></div>
                                    <div class="modal-footer" style="text-align: center !important">
                                        <button type="button" data-mitr="<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" style="opacity: 1;background: blue"
                                                class="close closeebill" data-dismiss="modal" aria-hidden="true">اعتماد</button>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <?php }?>
                        <td>
                            <input type="hidden" name="tempSaveBillIdRow<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" id="tempSaveBillIdRow<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
"
                                   value="<?php if ($_smarty_tpl->tpl_vars['tempSaveBillId']->value>0){?><?php echo $_smarty_tpl->tpl_vars['mymysellbildetales']->value->sellbilldetailid;?>
<?php }else{ ?>0<?php }?>">
                            <button id="remove<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" type="button" class="close flt-none removeicon removeproduct autoDelBillRow"
                                    aria-hidden="true">&times;</button>
                        </td>
                        </tr>
                        <?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 } ?>





                        <?php }else{ ?>



                        <tr id="productraw1">

                            <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[6]->billsettingsvalue;?>
<?php $_tmp70=ob_get_clean();?><?php if ($_tmp70==0){?> <?php }else{ ?> style="display:none !important;"
                                <?php }?>><a onClick="javascript:showProductModal(1, 7);"
                                         class="newLink btn btn-primary btn-xs conformdelProduct"><?php echo @SELL_BILL_NEW;?>
</a>
                            </td>
                            <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[40]->billsettingsvalue;?>
<?php $_tmp71=ob_get_clean();?><?php if ($_tmp71==0){?> <?php }else{ ?> style="display:none !important;"
                                <?php }?>><span class="proDetails" data-pro="product1">1</span></td>
                            <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[104]->billsettingsvalue;?>
<?php $_tmp72=ob_get_clean();?><?php if ($_tmp72==0){?> <?php }else{ ?> style="display:none !important;"
                                <?php }?>>
                                <input type="text" name="proSellTrackingSerial1" id="proSellTrackingSerial1"
                                       class="form-control txt-nonraduis autoSaveBillRow" tabindex="7" size="3" />
                            </td>
                            <td class="check_tr_parcode <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[59]->billsettingsvalue;?>
<?php $_tmp73=ob_get_clean();?><?php if ($_tmp73==1){?> hidden <?php }?>">
                                <div id="productparcode1">
                                    <input type="text" name="parcode1" id="parcode1"
                                           class="form-control txt-nonraduis autoSaveBillRow" tabindex="7"
                                           onkeypress="getproductbyParcode(event, this.value, 1);" size="3"
                                           placeholder="<?php echo @SELL_BILL_BARCODE;?>
" />
                                    <input name="parcodeType1" id="parcodeType1" type="hidden" />
                                    <input name="productserailid1" id="productserailid1" type="hidden" />
                                    <input name="productQty1" id="productQty1" type="hidden" />
                                </div>
                            </td>
                            <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[26]->billsettingsvalue;?>
<?php $_tmp74=ob_get_clean();?><?php if ($_tmp74==0){?> <?php }else{ ?> style="display:none !important;"
                                <?php }?> >
                                <div id="prstoridsiv1">

                                    <?php if ($_smarty_tpl->tpl_vars['userdata']->value->userstoreid==0){?>
                                    <select class="select2 clientstore wdt100 autoSaveBillRow" name="prstorid1" id="prstorid1">
                                        <option value="-1"><?php echo @SELL_BILL_SELECT_STORE;?>
 </option>
                                        <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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>
                                    <?php }else{ ?>
                                    <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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;
?>
                                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp75=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
<?php $_tmp76=ob_get_clean();?><?php if ($_tmp75==$_tmp76){?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
 <?php }?>
                                    <?php } ?>
                                    <input name="prstorid1" id="prstorid1" class="selectstore" type="hidden"
                                           value="<?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
" />
                                    <?php }?>
                                </div>
                            </td>

                            <!--  productdiv -->
                            <td>
                                <div id="productdiv1">
                                    <input type="hidden" id="product1" name="product1"
                                           class="select2product wdt100 autoSaveBillRow"
                                           data-placeholder="<?php echo @SELL_BILL_SELECT_PRODUCT;?>
 " tabindex="7" />
                                </div>
                            </td>

                            <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[7]->billsettingsvalue;?>
<?php $_tmp77=ob_get_clean();?><?php if ($_tmp77==0){?> <?php }else{ ?> style="display:none !important"
                                <?php }?>>
                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->sendBillToRestaurant==1){?>
                                <img class="drinkDetails" data-productid="" data-itr="1" width="20px" height="20px"
                                     src="../views/default/assets/img/notes2.png" alt="">
                                <span id="notes1"></span>
                                <input type="hidden" name="hiddenNotes1" id="hiddenNotes1" value="">
                                <?php }else{ ?>
                                <textarea class="form-control txt-nonraduis enteraction autoSaveBillRow" name="comment1"
                                          id="comment1" rows="1" tabindex="7"></textarea>
                                <?php }?>
                            </td>

                            <!-- productunitdiv -->
                            <td class="check_tr_unit <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[53]->billsettingsvalue;?>
<?php $_tmp78=ob_get_clean();?><?php if ($_tmp78==1){?>  hidden <?php }?>">
                                <div id="productunitdiv1">
                                    <input type="hidden" name="proNum1" id="proNum1" value="" />
                                    <select id="productunit1" name="productunit1" class="select2 wdt100 autoSaveBillRow"
                                            tabindex="7">
                                        <option value="-1"></option>
                                    </select>
                                </div>
                            </td>

                            <td
                                class="wdt100n check_tr_Height <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp79=ob_get_clean();?><?php if ($_tmp79==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                <input type="text" name="proHeight1" id="proHeight1" value="1"
                                       class="form-control txt-nonraduis enteraction numberinput positivefloat autoSaveBillRow"
                                       onKeyUp="calcQuantity(1, event);" tabindex="7" />
                            </td>
                            <td
                                class="wdt100n check_tr_Width <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp80=ob_get_clean();?><?php if ($_tmp80==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                <input type="text" name="proWidth1" id="proWidth1" value="1"
                                       class="form-control txt-nonraduis enteraction numberinput positivefloat autoSaveBillRow"
                                       onKeyUp="calcQuantity(1, event);" tabindex="7" />
                            </td>

                            <td class="check_tr_quantity <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp81=ob_get_clean();?><?php if ($_tmp81==1){?>  hidden <?php }?>">
                                <input type="text" name="pronum1" id="pronum1"
                                       class="form-control txt-nonraduis getprototal enteraction numberinput positivefloat autoSaveBillRow"
                                       onKeyUp="checkquantity(1, event);" value="1" tabindex="7" />
                            </td>
                            <td class="  <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->scunitname;?>
<?php $_tmp82=ob_get_clean();?><?php if ($_tmp82=='0'){?>  hidden <?php }?>">
                                <input name="scunitname1" id="scunitname1" value="0"
                                       class="form-control txt-nonraduis positiveNo autoSaveBillRow"
                                       placeholder="<?php echo @SELL_BILL_QUANTITY;?>
" type="text" tabindex="7" />
                            </td>

                            <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[38]->billsettingsvalue;?>
<?php $_tmp83=ob_get_clean();?><?php if ($_tmp83==0){?> <?php }else{ ?> style="display:none !important;"
                                <?php }?>>
                                <input type="text" name="bouns1" id="bouns1"
                                       class="form-control txt-nonraduis getprototal enteraction numberinput positiveNo autoSaveBillRow"
                                       value="0" tabindex="7" />
                            </td>
                            <td
                                class="showrowPriceType <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[83]->billsettingsvalue;?>
<?php $_tmp84=ob_get_clean();?><?php if ($_tmp84==1){?>  <?php }else{ ?> hidden <?php }?>">
                                <select class="select2 wdt100 autoSaveBillRow" name="pricetypepro1" id="pricetypepro1">
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
                                    <option value="0" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==0){?> selected="selected"
                                        <?php }?> ><?php echo @SELL_BILL_WHOLESALE;?>
</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
                                    <option value="1" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==1){?> selected="selected"
                                        <?php }?> ><?php echo @SELL_BILL_RETAIL;?>
</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
                                    <option value="2" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==2){?> selected="selected"
                                        <?php }?>><?php echo @SELL_BILL_HALF_WHOLESALE;?>
 </option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
                                    <option value="4" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==4){?> selected="selected"
                                        <?php }?>><?php echo @SELL_BILL_PRICE4;?>
 </option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
                                    <option value="5" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==5){?> selected="selected"
                                        <?php }?>><?php echo @SELL_BILL_PRICE5;?>
 </option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
                                    <option value="6" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==4){?> selected="selected"
                                        <?php }?>><?php echo @SELL_BILL_PRICE6;?>
 </option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
                                    <option value="7" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==4){?> selected="selected"
                                        <?php }?>><?php echo @SELL_BILL_PRICE7;?>
 </option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
                                    <option value="8" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==4){?> selected="selected"
                                        <?php }?>><?php echo @SELL_BILL_PRICE8;?>
 </option>
                                    <?php }?>
                                </select>
                            </td>
                            <td class="<?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                <div id="propricechange1">
                                    <input type="text" name="proprice1" id="proprice1"
                                           class="form-control getprototal enteraction numberinput txt-nonraduis positivefloat autoSaveBillRow"
                                           value="0" tabindex="7" />
                                </div>
                            </td>


                            <td
                                class="check_tr_discount <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
<?php $_tmp85=ob_get_clean();?><?php if ($_tmp85==1){?>  hidden <?php }?>">

                                <div class="input-group">
                                    <input name="prodis1" id="prodis1" class="form-control txt-nonraduis getprototal enteraction numberinput positiveNo autoSaveBillRow
                                           <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue==1){?> hidden <?php }?>" value="0"
                                           tabindex="7" />
                                    <input name="discounttype1" id="discounttype1" class="form-control txt-nonraduis getprototal enteraction numberinput positivefloat autoSaveBillRow
                                           <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue==0){?> hidden <?php }?>" value="0"
                                           tabindex="7" />



                                    <span class="input-group-addon small-addon discountSpan" data-itr="1">
                                        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue;?>
<?php $_tmp86=ob_get_clean();?><?php if ($_tmp86==0){?>C
                                        <?php }else{ ?>
                                        %
                                        <?php }?>
                                    </span>
                                </div>
                            </td>
                            <!-------------------------------------discountvalue by hazem---------------------------------------------->
                            <!--td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
<?php $_tmp87=ob_get_clean();?><?php if ($_tmp87==0){?>  <?php }else{ ?> style="display:none !important" <?php }?>>
                                              <input type="text" name="prodisper1" id="prodisper1"  class="form-control txt-nonraduis getprototal enteraction numberinput" value="0" tabindex="7"  />
                                            </td-->
                            <!-------------------------------------discountvalue by hazem---------------------------------------------->
                            <td class="<?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                <!--<div id="prototal1" class="form-control-static">0</div>-->
                                <!--<input name="hidden_prototal1" id="hidden_prototal1" type="hidden" value="0" />-->
                                <input name="hidden_prototal1" id="hidden_prototal1"
                                       class="editTotal form-control txt-nonraduis enteraction numberinput positiveNo autoSaveBillRow"
                                       value="0" type="text" />
                            </td>
                            <td class="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->expiredate;?>
<?php $_tmp88=ob_get_clean();?><?php if ($_tmp88==1){?>  hidden <?php }?>">
                                <input type="hidden" name="proSerials1" id="proSerials1" data-itr="1" class="autoSaveBillRow"
                                       value="">
                            </td>

                            <td class="<?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->ebillclient==0){?>  hidden <?php }?>">

                                <button type="button" class="btn btn-primary Taxes" data-mitr="1" data-toggle="modal"
                                        data-whatever="@mdo"></button>

                            </td>
                        <div class="modal fade" id="ebillclient1" role="dialog" aria-labelledby="exampleModalLabel"
                             aria-hidden="true">
                            <div class="modal-dialog modal-lg" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close pull-left" data-dismiss="modal"
                                                aria-hidden="true">×</button>
                                    </div>
                                    <div class="modal-body">
                                        <div style="display: none">
                                            <button type="button" class="btn green-meadow btn-sm pull-right addtaxes"
                                                    id="addtaxes1" data-mitr="1" style="background: #55ff55"> اضافه ضريبه
                                            </button>
                                            <button type="button" style="background: #f34141"
                                                    class="btn green-meadow btn-sm pull-right removetaxes" id="removetaxes"
                                                    data-edit='0' data-mitr="1"> حذف </button>
                                            <input type="hidden" id="taxesitr_1" data-mitr="1" name="taxesitr_1" value="1">
                                        </div>
                                        <div style="clear: both;"></div>

                                        <ul id="taxes1">
                                            <li id="litaxes_1_1">
                                                <div style="    width: 20% !important;float: right;">
                                                    <input type="hidden" name="type_1_1" class="eTaxType" id="eTaxType_1_1"
                                                           data-mitr="1" data-itr="1">
                                                </div>
                                                <div style="    width: 20% !important;float: right;">
                                                    <input type="hidden" name="subtype_1_1" id="eTaxsubtype_1_1"
                                                           class="eTaxsubtype" data-itr="1" data-mitr="1">
                                                </div>
                                                <div style=" width: 20% !important;float: right;">
                                                    <input type="text" name="rate_1_1"
                                                           class="form-control must_go_req ncloseebill rates rate_1"
                                                           id="rate_1_1" data-mitr="1" data-itr="1" placeholder="نسبه">
                                                </div>
                                                <div style="width: 20% !important;float: right;">
                                                    <input type="text" name="amount_1_1" class="form-control must_go_req ncloseebill
                                                           amounts  amount_1" id="amount_1_1" data-itr="1"
                                                           data-mitr="1" placeholder="المبلغ">
                                                </div>
                                                <div style="width: 20% !important;float: right;">
                                                    <!--<button type="button"  style="background: #f34141" class="btn green-meadow btn-sm pull-right  removeellbilldetailtax" data-edit='0'  data-itr="1" data-mitr="1"> x </button>-->
                                                </div>
                                            </li>
                                            <div style="clear: both;"></div>
                                        </ul>
                                    </div>
                                    <div style="clear: both;"></div>
                                    <div class="modal-footer" style="text-align: center !important">
                                        <button type="button" data-mitr="1" style="opacity: 1;background: blue"
                                                class="close closeebill" data-dismiss="modal" aria-hidden="true">اعتماد</button>
                                    </div>
                                </div>

                            </div>
                        </div>

                        <td>
                            <input type="hidden" name="tempSaveBillIdRow1" id="tempSaveBillIdRow1" value="0">
                            <button id="remove1" data-itr="1" data-mitr="1" type="button"
                                    class="close flt-none removeicon removeproduct autoDelBillRow"
                                    aria-hidden="true">&times;</button>
                        </td>
                        </tr>



                        <?php }?>
                        </tbody>
                    </table>
                </div>
                <button type="button"
                        class="btn btn-primary pull-left ft-nor <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                    <?php echo @SELL_BILL_TOTAL_SALES;?>
 <span class="badge wht-clo">
                        <div id="sellbilltotal">0</div>
                    </span>
                    <input type="hidden" name="sellbillprice" id="sellbillprice" value="0" />
                </button>
            </div>
            <div class="clearfix"></div>
            <!-- end of second row-->
            <div class="" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[0]->billsettingsvalue;?>
<?php $_tmp89=ob_get_clean();?><?php if ($_tmp89==0){?> <?php }else{ ?> style="display:none !important" <?php }?>>
                <div class="row">
                    <hr />
                    <div class="col-lg-6">
                        <h4 id="header4retSell"><?php echo @RETURN_SELL_BILL_SALES_RETURNS;?>
</h4>
                    </div>
                    <div class="col-lg-6">
                        <button type="button" name="addreturn" id="addreturn"
                                class="btn btn-primary pull-left ft-nor"><?php echo @SELL_BILL_ADD_NEW;?>
</button>

                        <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value!=1){?>
                        <button type="button" class="btn btn-success pull-left ft-nor addManyParcodes" data-type="ret"
                                style="margin-left:3px;"><?php echo @SELL_BILL_COMBINED_BARCODE;?>
 </button>
                        <?php }?>
                    </div>
                </div>
                <!-- end of title row-->
                <div class="table-responsive bd-rd">
                    <table class="table billtable table-bordered table-black" id="containerReturn" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[0]->billsettingsvalue;?>
<?php $_tmp90=ob_get_clean();?><?php if ($_tmp90==0){?> <?php }else{ ?> style="display:none !important" <?php }?>>
                        <thead>
                            <tr>
                                <th class="wdt20" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[40]->billsettingsvalue;?>
<?php $_tmp91=ob_get_clean();?><?php if ($_tmp91==0){?> <?php }else{ ?>
                                    style="display:none !important;" <?php }?>><?php echo @SELL_BILL_NUMBER;?>
</th>
                                <th
                                    class="wdt20 <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[104]->billsettingsvalue;?>
<?php $_tmp92=ob_get_clean();?><?php if ($_tmp92==0){?> proSellTrackingSerialClass <?php }else{ ?> hidden <?php }?>">
                                    Serial</th><!--السيريال الثانوى-->
                                <th
                                    class="wdt120 check_tr_parcode <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[59]->billsettingsvalue;?>
<?php $_tmp93=ob_get_clean();?><?php if ($_tmp93==1){?> hidden <?php }?>">
                                    <?php echo @SELL_BILL_BARCODE;?>
</th>
                                <th class="wdt300 " <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[26]->billsettingsvalue;?>
<?php $_tmp94=ob_get_clean();?><?php if ($_tmp94==0){?> <?php }else{ ?>
                                    style="display:none !important" <?php }?>><?php echo @SELL_BILL_STORE;?>
</th>
                                <th class="wdt400"><?php echo @SELL_BILL_PRODUCT_NAME;?>
</th>

                                <th class="wdt240" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[7]->billsettingsvalue;?>
<?php $_tmp95=ob_get_clean();?><?php if ($_tmp95==0){?> <?php }else{ ?>
                                    style="display:none !important" <?php }?>><?php echo @SELL_BILL_NOTES;?>
</th>
                                <th
                                    class="wdt100n check_tr_unit <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[53]->billsettingsvalue;?>
<?php $_tmp96=ob_get_clean();?><?php if ($_tmp96==1){?>  hidden <?php }?>">
                                    <?php echo @SELL_BILL_UNIT;?>
</th>
                                <th
                                    class="wdt100n check_tr_Height <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp97=ob_get_clean();?><?php if ($_tmp97==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    الطول</th>
                                <th
                                    class="wdt100n check_tr_Width <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp98=ob_get_clean();?><?php if ($_tmp98==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    العرض</th>
                                <th
                                    class="wdt100n check_tr_quantity <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp99=ob_get_clean();?><?php if ($_tmp99==1){?>  hidden <?php }?>">
                                    <?php echo @SELL_BILL_QUANTITY;?>
</th>
                                <th class="wdt100n   <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->scunitname;?>
<?php $_tmp100=ob_get_clean();?><?php if ($_tmp100=='0'){?>  hidden <?php }?>">
                                    <?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->scunitname;?>
</th>
                                <th
                                    class="wdt80 showrowPriceType <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[83]->billsettingsvalue;?>
<?php $_tmp101=ob_get_clean();?><?php if ($_tmp101==1){?>  <?php }else{ ?> hidden <?php }?>">
                                    <?php echo @SELL_BILL_PRICE_TYPE;?>
</th>
                                <th class="wdt80 <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <?php echo @SELL_BILL_PRICE;?>
</th>
                                <th
                                    class="wdt80 check_tr_discount <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
<?php $_tmp102=ob_get_clean();?><?php if ($_tmp102==1){?>  hidden <?php }?>">
                                    <?php echo @SELL_BILL_DISCOUNT;?>
</th>
                                <th class="wdt100n <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <?php echo @SELL_BILL_TOTAL;?>

                                    <input name="returnhidden_itr" id="returnhidden_itr" type="hidden"
                                           value="<?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['returndetalesitr']->value>0){?><?php echo $_smarty_tpl->tpl_vars['returndetalesitr']->value;?>
<?php }else{ ?>1<?php }?>" />
                                </th>
                                <th class="check_tr_soldSerials <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->expiredate;?>
<?php $_tmp103=ob_get_clean();?><?php if ($_tmp103==1){?>  hidden <?php }?>">سريل
                                </th>
                                <th><?php echo @SELL_BILL_DELETE;?>
</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1&&$_smarty_tpl->tpl_vars['returndetalesitr']->value>0){?>



                            <?php $_smarty_tpl->tpl_vars['y'] = new Smarty_variable(1, null, 0);?>
                            <?php  $_smarty_tpl->tpl_vars['myreturnmysellbildetales'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['returnmysellbildetales']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->key => $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value){
$_smarty_tpl->tpl_vars['myreturnmysellbildetales']->_loop = true;
?>
                            <tr>
                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[40]->billsettingsvalue;?>
<?php $_tmp104=ob_get_clean();?><?php if ($_tmp104==0){?> <?php }else{ ?> style="display:none !important;"
                                    <?php }?>><span class="proDetails" data-pro="returnproduct<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['y']->value;?>
</span></td>
                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[104]->billsettingsvalue;?>
<?php $_tmp105=ob_get_clean();?><?php if ($_tmp105==0){?> <?php }else{ ?> style="display:none
                                    !important;" <?php }?>>
                                    <input type="text" name="retproSellTrackingSerial<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="retproSellTrackingSerial<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                           class="form-control txt-nonraduis autoSaveBillRowRet" tabindex="7" size="3" />
                                </td>
                                <td class="check_tr_parcode <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[59]->billsettingsvalue;?>
<?php $_tmp106=ob_get_clean();?><?php if ($_tmp106==1){?> hidden <?php }?>">
                                    <div id="returnproductparcode<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
">
                                        <input type="text" name="returnparcode<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnparcode<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                               class="form-control txt-nonraduis autoSaveBillRowRet" placeholder="الباركود"
                                               onkeypress="getreturnproductbyParcode(event, this.value, <?php echo $_smarty_tpl->tpl_vars['y']->value;?>
);" tabindex="301"
                                               value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->parcode;?>
">
                                        <input name="returnparcodeType<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnparcodeType<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" type="hidden"
                                               value="<?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->productserailid>0){?>serialnumber<?php }?>" />
                                        <input name="returnproductserailid<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnproductserailid<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" type="hidden"
                                               value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->productserailid;?>
" />
                                        <input name="returnproductQty<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnproductQty<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" type="hidden"
                                               value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->don;?>
" />
                                    </div>
                                </td>

                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[26]->billsettingsvalue;?>
<?php $_tmp107=ob_get_clean();?><?php if ($_tmp107==0){?> <?php }else{ ?> style="display:none !important"
                                    <?php }?>>
                                    <div id="prstoridsiv<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
">

                                        <?php if ($_smarty_tpl->tpl_vars['userdata']->value->userstoreid==0){?>
                                        <select class="select2 clientstore wdt100 autoSaveBillRowRet" name="reprstorid<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                                id="reprstorid<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
">
                                            <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['storeData']->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 ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp108=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->storeid;?>
<?php $_tmp109=ob_get_clean();?><?php if ($_tmp108==$_tmp109){?> selected="selected"
                                                <?php }?>><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
</option>
                                            <?php } ?>
                                        </select>
                                        <?php }else{ ?>
                                        <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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;
?>
                                        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp110=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->storeid;?>
<?php $_tmp111=ob_get_clean();?><?php if ($_tmp110==$_tmp111){?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
 <?php }?>
                                        <?php } ?>
                                        <input name="reprstorid<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="reprstorid<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" class="selectstore" type="hidden"
                                               value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->storeid;?>
" />
                                        <?php }?>
                                    </div>
                                </td>

                                <td>
                                    <div id="returnproductdiv<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
">
                                        <input type="hidden" id="returnproduct<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" name="returnproduct<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                               class="select2returnproduct wdt100 autoSaveBillRowRet" data-placeholder="اختر منتج"
                                               tabindex="301" />

                                        <input type="hidden" id="reoldproduct<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" name="reoldproduct<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                               value="<?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sizeid>0&&$_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->colorid>0){?>hasSizeColor<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sellbilldetailproductid;?>
<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->returnsellbilldetailproductid;?>
-<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sizeid;?>
-<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->colorid;?>
<?php }else{ ?><?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sellbilldetailproductid;?>
<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->returnsellbilldetailproductid;?>
<?php }?>" />
                                        <input type="hidden" id="reoldname<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" name="reoldname<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                               value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->productName;?>

                                               <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sizeName!=''){?>/ <?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sizeName;?>
<?php }?>
                                               <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->colorName!=''){?>/ <?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->colorName;?>
<?php }?>" />

                                    </div>
                                </td>




                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[7]->billsettingsvalue;?>
<?php $_tmp112=ob_get_clean();?><?php if ($_tmp112==0){?> <?php }else{ ?> style="display:none !important"
                                    <?php }?>>
                                    <textarea class="form-control txt-nonraduis returnenteraction autoSaveBillRowRet"
                                              name="returncomment<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returncomment<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" rows="1"
                                              tabindex="301"><?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->note;?>
</textarea>
                                </td>
                                <td class="check_tr_unit <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[53]->billsettingsvalue;?>
<?php $_tmp113=ob_get_clean();?><?php if ($_tmp113==1){?>  hidden <?php }?>">
                                    <div id="returnproductunitdiv<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
">

                                        <input type="hidden" name="retProNum<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="retProNum<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" value="" />
                                        <select class="select2 wdt100 autoSaveBillRowRet" id="returnproductunit<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                                name="returnproductunit<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" onChange="alert(11);
                                                        getreturnunitprice(<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
);">
                                            <option value="-1"></option>
                                            <?php  $_smarty_tpl->tpl_vars['remymyunitdata'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['remymyunitdata']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['myreunitdata'.($_smarty_tpl->tpl_vars['y']->value)]->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['remymyunitdata']->key => $_smarty_tpl->tpl_vars['remymyunitdata']->value){
$_smarty_tpl->tpl_vars['remymyunitdata']->_loop = true;
?>
                                            <option data-pu-num="<?php echo $_smarty_tpl->tpl_vars['remymyunitdata']->value->productnumber;?>
"
                                                    value="<?php echo $_smarty_tpl->tpl_vars['remymyunitdata']->value->productunitid;?>
" <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->productunitid==$_smarty_tpl->tpl_vars['remymyunitdata']->value->productunitid||$_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->productunitid==$_smarty_tpl->tpl_vars['remymyunitdata']->value->productunitid){?>
                                                selected="selected" <?php }?>><?php echo $_smarty_tpl->tpl_vars['remymyunitdata']->value->unitName;?>
 </option>
                                            <?php } ?>
                                        </select>
                                        <input name="oldunit<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="oldunit<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" type="hidden"
                                               value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->productunitid;?>
" />
                                        <input name="oldunitname<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="oldunitname<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" type="hidden"
                                               value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->unitName;?>
" />
                                    </div>
                                </td>
                                <td
                                    class="wdt100n check_tr_Height <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp114=ob_get_clean();?><?php if ($_tmp114==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    <input type="text" name="returnproHeight<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnproHeight<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                           value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->proHeight;?>
"
                                           class="form-control txt-nonraduis enteraction numberinput positivefloat autoSaveBillRowRet"
                                           onKeyUp="calcQuantityReturn(<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
, event);" tabindex="301" />
                                </td>
                                <td
                                    class="wdt100n check_tr_Width <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp115=ob_get_clean();?><?php if ($_tmp115==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    <input type="text" name="returnproWidth<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnproWidth<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                           value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->proWidth;?>
"
                                           class="form-control txt-nonraduis enteraction numberinput positivefloat autoSaveBillRowRet"
                                           onKeyUp="calcQuantityReturn(<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
, event);" tabindex="301" />
                                </td>
                                <td
                                    class="check_tr_quantity <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp116=ob_get_clean();?><?php if ($_tmp116==1){?>  hidden <?php }?>">
                                    <input type="text" name="returnpronum<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnpronum<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                           value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->returnsellbilldetailquantity;?>
<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sellbilldetailquantity;?>
"
                                           class="form-control txt-nonraduis getreurnprototal returnenteraction positiveNo autoSaveBillRowRet"
                                           onKeyUp="returncheckquantity(<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
, event);" value="1" tabindex="301" />
                                </td>

                                <td class="  <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->scunitname;?>
<?php $_tmp117=ob_get_clean();?><?php if ($_tmp117=='0'){?>  hidden <?php }?>">
                                    <input name="returnscunitname<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnscunitname<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                           value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->otherdetailquantity;?>
"
                                           class="form-control txt-nonraduis positiveNo autoSaveBillRowRet" placeholder="العدد"
                                           type="text" tabindex="7" />
                                </td>
                                <td
                                    class="showrowPriceType <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[83]->billsettingsvalue;?>
<?php $_tmp118=ob_get_clean();?><?php if ($_tmp118==1){?>  <?php }else{ ?> hidden <?php }?>">
                                    <select class="select2 wdt100 autoSaveBillRowRet" name="retpricetypepro<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                            id="retpricetypepro<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
">
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
                                        <option value="0" <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->pricetypepro==0){?> selected="selected"
                                            <?php }?> >جملة</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
                                        <option value="1" <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->pricetypepro==1){?> selected="selected"
                                            <?php }?> >تجزئة</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
                                        <option value="2" <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->pricetypepro==2){?> selected="selected"
                                            <?php }?>>نصف جملة</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
                                        <option value="4" <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->pricetypepro==4){?> selected="selected"
                                            <?php }?>>سعر4</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
                                        <option value="5" <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->pricetypepro==5){?> selected="selected"
                                            <?php }?>>سعر5</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
                                        <option value="6" <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->pricetypepro==4){?> selected="selected"
                                            <?php }?>>سعر6</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
                                        <option value="7" <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->pricetypepro==4){?> selected="selected"
                                            <?php }?>>سعر7</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
                                        <option value="8" <?php if ($_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->pricetypepro==4){?> selected="selected"
                                            <?php }?>>سعر8</option>
                                        <?php }?>
                                    </select>
                                </td>
                                <td class="<?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <div id="returnpropricechange<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
">
                                        <input type="text" name="returnproprice<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnproprice<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                               class="form-control getreurnprototal txt-nonraduis returnenteraction numberinput autoSaveBillRowRet"
                                               value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->returnsellbilldetailprice;?>
<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sellbilldetailprice;?>
"
                                               tabindex="301" />
                                    </div>
                                </td>
                                <td
                                    class="check_tr_discount <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
<?php $_tmp119=ob_get_clean();?><?php if ($_tmp119==1){?>  hidden <?php }?> <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <!--input type="text" name="returnprodis<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnprodis<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"  class="form-control getreurnprototal  txt-nonraduis returnenteraction numberinput" value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->discountvalue;?>
" tabindex="301" /-->

                                    <div class="input-group">
                                        <input name="returnprodis<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnprodis<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" class="form-control getreurnprototal  txt-nonraduis returnenteraction numberinput autoSaveBillRowRet
                                               <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue==1){?> hidden <?php }?>"
                                               value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->discountvalue;?>
" tabindex="301" type="text" />

                                        <input name="returndiscounttype<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returndiscounttype<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" class="form-control getreurnprototal  txt-nonraduis returnenteraction numberinput autoSaveBillRowRet
                                               <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue==0){?> hidden <?php }?>"
                                               tabindex="301" value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->discounttype;?>
" type="text" />


                                        <span class="input-group-addon small-addon retdiscountSpan" data-itr="<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
">
                                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue;?>
<?php $_tmp120=ob_get_clean();?><?php if ($_tmp120==0){?>C
                                            <?php }else{ ?>
                                            %
                                            <?php }?>
                                        </span>
                                    </div>

                                </td>
                                <td class="<?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <p class="form-control-static" id="reurnprototal<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
">
                                        <?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->returnsellbilldetailtotalprice;?>
<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sellbilldetailtotalprice;?>

                                    </p>
                                    <input name="returnhidden_prototal<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="returnhidden_prototal<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" type="hidden"
                                           value="<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->returnsellbilldetailtotalprice;?>
<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sellbilldetailtotalprice;?>
" />
                                </td>
                                <td class="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->expiredate;?>
<?php $_tmp121=ob_get_clean();?><?php if ($_tmp121==1){?>  hidden <?php }?>">
                                    <input type="hidden" name="proSerialsRet<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="proSerialsRet<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                           class="autoSaveBillRowRet" value="">
                                    <input type='hidden' id='oldproSerialsRet<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
'
                                           value='<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->soldSerialsInDetails;?>
' />
                                </td>
                                <td>
                                    <input type="hidden" name="tempSaveBillIdRowRet<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
" id="tempSaveBillIdRowRet<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                           value="<?php if ($_smarty_tpl->tpl_vars['tempSaveBillId']->value>0){?><?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->sellbilldetailid;?>
<?php echo $_smarty_tpl->tpl_vars['myreturnmysellbildetales']->value->returnsellbilldetailid;?>
<?php }else{ ?>0<?php }?>">
                                    <button type="button" id="returnremove<?php echo $_smarty_tpl->tpl_vars['y']->value;?>
"
                                            class="close flt-none returnremoveproduct autoDelBillRowRet"
                                            aria-hidden="true">&times;</button>
                                </td>
                            </tr>

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





                            <?php }else{ ?>



                            <tr>
                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[40]->billsettingsvalue;?>
<?php $_tmp122=ob_get_clean();?><?php if ($_tmp122==0){?> <?php }else{ ?> style="display:none !important;"
                                    <?php }?>><span class="proDetails" data-pro="returnproduct1">1</span></td>
                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[104]->billsettingsvalue;?>
<?php $_tmp123=ob_get_clean();?><?php if ($_tmp123==0){?> <?php }else{ ?> style="display:none
                                    !important;" <?php }?>>
                                    <input type="text" name="retproSellTrackingSerial1" id="retproSellTrackingSerial1"
                                           class="form-control txt-nonraduis autoSaveBillRowRet" tabindex="7" size="3" />
                                </td>
                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[59]->billsettingsvalue;?>
<?php $_tmp124=ob_get_clean();?><?php if ($_tmp124==0){?> <?php }else{ ?> style="display:none" <?php }?>>
                                    <div id="returnproductparcode1">
                                        <input type="text" name="returnparcode1" id="returnparcode1"
                                               class="form-control txt-nonraduis autoSaveBillRowRet"
                                               placeholder="<?php echo @SELL_BILL_BARCODE;?>
"
                                               onkeypress="getreturnproductbyParcode(event, this.value, 1);" tabindex="301" />
                                        <input name="returnparcodeType1" id="returnparcodeType1" type="hidden" />
                                        <input name="returnproductserailid1" id="returnproductserailid1" type="hidden" />
                                        <input name="returnproductQty1" id="returnproductQty1" type="hidden" />
                                    </div>
                                </td>
                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[26]->billsettingsvalue;?>
<?php $_tmp125=ob_get_clean();?><?php if ($_tmp125==0){?> <?php }else{ ?> style="display:none !important"
                                    <?php }?>>

                                    <div id="prstoridsiv1">

                                        <?php if ($_smarty_tpl->tpl_vars['userdata']->value->userstoreid==0){?>
                                        <select class="select2 clientstore wdt100 autoSaveBillRowRet" name="reprstorid1"
                                                id="reprstorid1">
                                            <option value="-1"><?php echo @SELL_BILL_SELECT_STORE;?>
</option>
                                            <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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>
                                        <?php }else{ ?>
                                        <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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;
?>
                                        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
<?php $_tmp126=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
<?php $_tmp127=ob_get_clean();?><?php if ($_tmp126==$_tmp127){?><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
 <?php }?>
                                        <?php } ?>
                                        <input name="reprstorid1" id="reprstorid1" class="selectstore" type="hidden"
                                               value="<?php echo $_smarty_tpl->tpl_vars['userdata']->value->userstoreid;?>
" />
                                        <?php }?>
                                    </div>
                                </td>
                                <td>
                                    <div id="returnproductdiv1">

                                        <input type="hidden" id="returnproduct1" name="returnproduct1"
                                               class="select2returnproduct wdt100 autoSaveBillRowRet"
                                               data-placeholder="<?php echo @SELL_BILL_SELECT_PRODUCT;?>
" tabindex="301" />
                                    </div>
                                </td>





                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[7]->billsettingsvalue;?>
<?php $_tmp128=ob_get_clean();?><?php if ($_tmp128==0){?> <?php }else{ ?> style="display:none !important"
                                    <?php }?>>
                                    <textarea class="form-control txt-nonraduis returnenteraction autoSaveBillRowRet"
                                              name="returncomment1" id="returncomment1" rows="1" tabindex="301"></textarea>
                                </td>
                                <td <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[53]->billsettingsvalue;?>
<?php $_tmp129=ob_get_clean();?><?php if ($_tmp129==0){?> <?php }else{ ?> style="display:none !important"
                                    <?php }?>>
                                    <div id="returnproductunitdiv1">
                                        <select id="returnproductunit1" name="returnproductunit1"
                                                class="select2 wdt100 autoSaveBillRowRet" tabindex="301">
                                            <option value="-1"></option>
                                        </select>
                                    </div>
                                </td>
                                <td
                                    class="wdt100n check_tr_Height <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp130=ob_get_clean();?><?php if ($_tmp130==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    <input type="text" name="returnproHeight1" id="returnproHeight1" value="1"
                                           class="form-control txt-nonraduis enteraction numberinput positivefloat autoSaveBillRowRet"
                                           onKeyUp="calcQuantityReturn(1, event);" tabindex="301" />
                                </td>
                                <td
                                    class="wdt100n check_tr_Width <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp131=ob_get_clean();?><?php if ($_tmp131==1||$_smarty_tpl->tpl_vars['billsettingsData']->value[100]->billsettingsvalue==0){?>  hidden <?php }?>">
                                    <input type="text" name="returnproWidth1" id="returnproWidth1" value="1"
                                           class="form-control txt-nonraduis enteraction numberinput positivefloat autoSaveBillRowRet"
                                           onKeyUp="calcQuantityReturn(1, event);" tabindex="301" />
                                </td>
                                <td
                                    class="check_tr_quantity <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[64]->billsettingsvalue;?>
<?php $_tmp132=ob_get_clean();?><?php if ($_tmp132==1){?>  hidden <?php }?>">
                                    <input type="text" name="returnpronum1" id="returnpronum1"
                                           class="form-control txt-nonraduis getreurnprototal returnenteraction numberinput positivefloat autoSaveBillRowRet"
                                           onKeyUp="returncheckquantity(1, event);" value="1" tabindex="301" />
                                </td>
                                <td class="  <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->scunitname;?>
<?php $_tmp133=ob_get_clean();?><?php if ($_tmp133=='0'){?>  hidden <?php }?>">
                                    <input name="returnscunitname1" id="returnscunitname1" value="0"
                                           class="form-control txt-nonraduis positiveNo autoSaveBillRowRet"
                                           placeholder="<?php echo @SELL_BILL_QUANTITY;?>
" type="text" tabindex="7" />
                                </td>
                                <td
                                    class="showrowPriceType <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[83]->billsettingsvalue;?>
<?php $_tmp134=ob_get_clean();?><?php if ($_tmp134==1){?>  <?php }else{ ?> hidden <?php }?>">
                                    <select class="select2 wdt100 autoSaveBillRowRet" name="retpricetypepro1"
                                            id="retpricetypepro1">

                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
                                        <option value="0" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==0){?> selected="selected"
                                            <?php }?> ><?php echo @SELL_BILL_WHOLESALE;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
                                        <option value="1" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==1){?> selected="selected"
                                            <?php }?> ><?php echo @SELL_BILL_RETAIL;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
                                        <option value="2" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==2){?> selected="selected"
                                            <?php }?>><?php echo @SELL_BILL_HALF_WHOLESALE;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
                                        <option value="4" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==4){?> selected="selected"
                                            <?php }?>><?php echo @SELL_BILL_PRICE4;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
                                        <option value="5" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==5){?> selected="selected"
                                            <?php }?>><?php echo @SELL_BILL_PRICE5;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
                                        <option value="6" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==4){?> selected="selected"
                                            <?php }?>><?php echo @SELL_BILL_PRICE6;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
                                        <option value="7" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==4){?> selected="selected"
                                            <?php }?>><?php echo @SELL_BILL_PRICE7;?>
</option>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
                                        <option value="8" <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[32]->billsettingsvalue==4){?> selected="selected"
                                            <?php }?>><?php echo @SELL_BILL_PRICE8;?>
</option>
                                        <?php }?>
                                    </select>
                                </td>
                                <td class="<?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <div id="returnpropricechange1">
                                        <input type="text" name="returnproprice1" id="returnproprice1"
                                               class="form-control getreurnprototal txt-nonraduis returnenteraction numberinput  positivefloat autoSaveBillRowRet"
                                               value="0" tabindex="301" />
                                    </div>
                                </td>
                                <td
                                    class="check_tr_discount <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[8]->billsettingsvalue;?>
<?php $_tmp135=ob_get_clean();?><?php if ($_tmp135==1){?>  hidden <?php }?>">

                                    <div class="input-group">
                                        <input name="returnprodis1" id="returnprodis1" class="form-control getreurnprototal  txt-nonraduis returnenteraction numberinput positiveNo autoSaveBillRowRet
                                               <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue==1){?> hidden <?php }?>"
                                               value="0" tabindex="301" type="text" />



                                        <input name="returndiscounttype1" id="returndiscounttype1" class="form-control getreurnprototal  txt-nonraduis returnenteraction numberinput positiveNo autoSaveBillRowRet
                                               <?php if ($_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue==0){?> hidden <?php }?>"
                                               value="0" tabindex="301" type="text" />



                                        <span class="input-group-addon small-addon retdiscountSpan" data-itr="1">
                                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[34]->billsettingsvalue;?>
<?php $_tmp136=ob_get_clean();?><?php if ($_tmp136==0){?>C
                                            <?php }else{ ?>
                                            %
                                            <?php }?>
                                        </span>
                                    </div>
                                </td>
                                <td class="<?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                                    <!--                                    <p class="form-control-static" id="reurnprototal1">0</p>
                                                                                        <input name="returnhidden_prototal1" id="returnhidden_prototal1" type="hidden" value="0" />-->
                                    <input name="returnhidden_prototal1" id="returnhidden_prototal1"
                                           class="returnEditTotal form-control txt-nonraduis enteraction numberinput positiveNo autoSaveBillRowRet"
                                           value="0" type="text" />
                                </td>
                                <td class="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->expiredate;?>
<?php $_tmp137=ob_get_clean();?><?php if ($_tmp137==1){?>  hidden <?php }?>">
                                    <input type="hidden" name="proSerialsRet1" id="proSerialsRet1" data-itr="1"
                                           class="autoSaveBillRowRet" value="">
                                </td>
                                <td>
                                    <input type="hidden" name="tempSaveBillIdRowRet1" id="tempSaveBillIdRowRet1" value="0">
                                    <button type="button" id="returnremove1"
                                            class="close flt-none returnremoveproduct autoDelBillRowRet"
                                            aria-hidden="true">&times;</button>
                                </td>
                            </tr>


                            <?php }?>
                        </tbody>
                    </table>
                </div>
                <button type="button"
                        class="btn btn-primary pull-left ft-nor <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[0]->billsettingsvalue;?>
<?php $_tmp138=ob_get_clean();?><?php if ($_tmp138==0){?> <?php }else{ ?> style="display:none !important"
                    <?php }?>><?php echo @RETURN_SELL_BILL_TOTAL_SALES_RETURNS;?>
 <span class="badge wht-clo"
                                                                                     id="returnsellbilltotal">0</span>
                    <input type="hidden" name="returnsellbillprice" id="returnsellbillprice" value="0" />
                </button>
            </div>

            <!-- end of third row-->

            <div class="row <?php if ($_smarty_tpl->tpl_vars['Usergroupdata']->value->hideBillPrices==1){?>hidden<?php }?>">
                <div class="col-lg-7">
                    <div id="closeebill">

                    </div>
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[49]->billsettingsvalue;?>
<?php $_tmp139=ob_get_clean();?><?php if ($_tmp139==0){?> <?php }else{ ?>
                        style="display:none !important" <?php }?>>
                        <label class="col-lg-3 control-label"><?php echo @SELL_BILL_PAID;?>
</label>
                        <div class="col-lg-3">
                            <input type="text" class="form-control" placeholder="<?php echo @SELL_BILL_PAID;?>
" id="genpay2"
                                   onkeyup="calculateremain(this.value);">
                        </div>
                    </div>
                    <!-- end of form-group-->

                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[49]->billsettingsvalue;?>
<?php $_tmp140=ob_get_clean();?><?php if ($_tmp140==0){?> <?php }else{ ?>
                        style="display:none !important" <?php }?>>
                        <label class="col-lg-3 control-label"><?php echo @SELL_BILL_REST;?>
</label>
                        <div class="col-lg-3">
                            <p class="form-control-static" id="gen3total2">0 <?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</p>
                        </div>
                    </div>
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->showProfitInsideBill;?>
<?php $_tmp141=ob_get_clean();?><?php if ($_tmp141==1){?> <?php }else{ ?>
                        style="display:none !important" <?php }?>>
                        <label class="col-lg-3 control-label">ربح الفاتورة</label>
                        <div class="col-lg-3">
                            <input type="text" class="form-control" id="profitVal" readonly>
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <div class="form-group" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[80]->billsettingsvalue;?>
<?php $_tmp142=ob_get_clean();?><?php if ($_tmp142==0){?> <?php }else{ ?> style="display:none"
                        <?php }?>>
                        <label class="col-lg-3 control-label"><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->delivery;?>
<?php $_tmp143=ob_get_clean();?><?php if ($_tmp143==0){?><?php echo @SELL_BILL_HAULAUGE;?>
<?php }else{ ?> <?php echo @SELL_BILL_DELIVERY;?>
 <?php }?></label>
                        <div class="col-lg-3">
                            <input type="hidden" id="billsettingsData_80" value="<?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[80]->billsettingsvalue;?>
" />
                            <span id="sprytextfield12">
                                <input type="text" class="form-control"
                                       placeholder="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->delivery;?>
<?php $_tmp144=ob_get_clean();?><?php if ($_tmp144==0){?><?php echo @SELL_BILL_HAULAUGE;?>
<?php }else{ ?> <?php echo @SELL_BILL_DELIVERY;?>
 <?php }?>"
                                       name="delivery" id="delivery" />
                                <span class="textfieldRequiredMsg">*</span><span
                                    class="textfieldInvalidFormatMsg"><?php echo @SELL_BILL_ENTER_CORRECT_VALUE;?>
</span>
                            </span>
                        </div>
                    </div>

                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[80]->billsettingsvalue;?>
<?php $_tmp145=ob_get_clean();?><?php if ($_tmp145==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-3 control-label"><?php echo @SELL_BILL_TOTAL_AMOUNT;?>
</label>
                        <div class="col-lg-7">
                            <p class="form-control-static mg-tp10" id="valdelivery">0</p>
                            <input type="hidden" name="valdeliveryhidden" id="valdeliveryhidden" value="0" />

                        </div>
                    </div>


                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[84]->billsettingsvalue;?>
<?php $_tmp146=ob_get_clean();?><?php if ($_tmp146==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-3 control-label"><?php echo @SELL_BILL_BILL_RESERVATION;?>
 </label>
                        <div class="col-lg-3">
                            <input type="checkbox" name="billReservation" id="billReservation" value="1" />
                        </div>
                    </div>
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[84]->billsettingsvalue;?>
<?php $_tmp147=ob_get_clean();?><?php if ($_tmp147==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-3 control-label"><?php echo @SELL_BILL_BOOKING_EXPIRTY_DATE;?>
</label>
                        <div class="col-lg-3">
                            <span id="billReservationDatesp">
                                <input type="text" class="form-control awdatepicker" autocomplete="off" id="billReservationDate"
                                       data-date-format="yyyy-mm-dd" name="billReservationDate" required="">
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[93]->billsettingsvalue;?>
<?php $_tmp148=ob_get_clean();?><?php if ($_tmp148==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-3 control-label"><?php echo @SELL_BILL_COLLECTION_METHOD;?>
 </label>
                        <div class="col-lg-4">
                            <div class="radio-inline">
                                <label>
                                    <input value="0" class="radioR" name="collectionType" type="radio" checked>
                                    <?php echo @SELL_BILL_WITHOUT;?>
</label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="1" class="radioR" name="collectionType" type="radio">
                                    <?php echo @SELL_BILL_CHEQUE;?>
 </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="2" class="radioR" name="collectionType" type="radio">
                                    <?php echo @SELL_BILL_OPEN;?>
 </label>
                            </div>

                        </div>
                    </div>
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[93]->billsettingsvalue;?>
<?php $_tmp149=ob_get_clean();?><?php if ($_tmp149==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-3 control-label"> <?php echo @SELL_BILL_DUE_DATE;?>
</label>
                        <div class="col-lg-3">
                            <input type="text" class="form-control awdatepicker" autocomplete="off" id="collectionDate"
                                   data-date-format="yyyy-mm-dd" name="collectionDate">
                        </div>
                    </div>

                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[91]->billsettingsvalue;?>
<?php $_tmp150=ob_get_clean();?><?php if ($_tmp150==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-3 control-label"> <?php echo @SELL_BILL_TOTAL_INCLUSIVE_VAT;?>
</label>
                        <div class="col-lg-3">
                            <input type="text" class="form-control positivefloat" id="vatIncludedTotalIfRow" value="" />
                        </div>
                    </div>

                </div>
                <!-- end of calucation center-->

                <div class="col-lg-5 card">
                    <hr />
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[58]->billsettingsvalue;?>
<?php $_tmp151=ob_get_clean();?><?php if ($_tmp151==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-5 col-sm-7 control-label"> <?php echo @SELL_BILL_NUMBER_PIECES_SOLD;?>
</label>
                        <div class="col-lg-7 col-sm-5">
                            <p class="form-control-static mg-tp10" id="totalQty">0</p>
                            <input type="hidden" name="sellQuantity" id="sellQuantity" value="0" />
                        </div>
                    </div>
                    <!-- end of form-group-->

                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[0]->billsettingsvalue;?>
<?php $_tmp152=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[58]->billsettingsvalue;?>
<?php $_tmp153=ob_get_clean();?><?php if ($_tmp152==0&&$_tmp153==0){?> <?php }else{ ?> style="display:none !important" <?php }?>>
                        <label class="col-lg-5 col-sm-7 control-label"> <?php echo @SELL_BILL_NUMBER_PIECES_RETURNED;?>
</label>
                        <div class="col-lg-7 col-sm-5">
                            <p class="form-control-static mg-tp10" id="returnTotalQty">0</p>
                            <input type="hidden" name="returnsellQuantity" id="returnsellQuantity" value="0" />
                        </div>
                    </div>
                    <!-- end of form-group-->

                    <div class="form-group mg-bt5">
                        <label class="col-lg-5 col-sm-7 control-label"> <?php echo @SELL_BILL_BILL_VALUE;?>
</label>
                        <div class="col-lg-7 col-sm-5">
                            <p class="form-control-static mg-tp10" id="gentotal">0</p>
                            <input type="hidden" name="sellbilltotalbill" id="sellbilltotalbill" value="0" />
                            <input type="hidden" name="etotal" id="etotal" value="0" />
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[90]->billsettingsvalue;?>
<?php $_tmp154=ob_get_clean();?><?php if ($_tmp154==1&&$_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountPlace==1){?>
                    <div>
                        <!--<hr class="mg-tp5 mg-bt5"/>-->
                        <div class="form-group mg-bt5">
                            <label class="col-lg-5 col-sm-7 control-label"> <?php if ($_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountFixed==1){?>
                                (<?php echo $_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountPer;?>
%) <?php }?> <?php echo @SELL_BILL_EXTRA_DISCOUNT;?>
</label>
                            <div class="col-lg-7 col-sm-5">
                                <?php if ($_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountFixed==0){?>
                                <div class="input-group">
                                    <input type="text" name="extraDiscountPer" class="form-control numberinput positiveNo"
                                           id="extraDiscountPer" value="0" />
                                    <span class="input-group-addon">%</span>
                                </div>
                                <?php }else{ ?>
                                <input type="hidden" name="extraDiscountPer" id="extraDiscountPer"
                                       value="<?php echo $_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountPer;?>
" />
                                <?php }?>
                                <div class="input-group" style="padding-top: 1px;">
                                    <input type="text" name="extraDiscountVal" class="form-control numberinput positiveNo"
                                           id="extraDiscountVal" value="0" readonly />
                                    <input type="hidden" name="extraDiscountVal_h" id="extraDiscountVal_h" value="0" />
                                    <span class="input-group-addon"><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->currancy;?>
</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php }?>
                    <!-- end of form-group-->
                    <div
                        class="form-group mg-bt5 check_tr_discount <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[42]->billsettingsvalue;?>
<?php $_tmp155=ob_get_clean();?><?php if ($_tmp155==1){?>  hidden <?php }?>">
                        <label class="col-lg-5 col-sm-7 control-label"> <?php echo @SELL_BILL_DISCOUNT_TYPE;?>
</label>
                        <div class="col-lg-7 col-sm-5">
                            <select id="distype" name="distype" class="select2 wdt100 autoSaveBillMainPart"
                                    onchange="checkdisValue();">
                                <option <?php if (($_smarty_tpl->tpl_vars['offerId']->value==0&&$_smarty_tpl->tpl_vars['billsettingsData']->value[44]->billsettingsvalue==0)||(($_smarty_tpl->tpl_vars['offerId']->value>0||$_smarty_tpl->tpl_vars['manyParcodes']->value==1)&&$_smarty_tpl->tpl_vars['mysellbilldata']->value->sellbilldiscounttype!=2)){?> selected="selected"
                                    <?php }?> value="1"><?php echo @SELL_BILL_LIVE;?>
</option>
                                <option <?php if (($_smarty_tpl->tpl_vars['offerId']->value==0&&$_smarty_tpl->tpl_vars['billsettingsData']->value[44]->billsettingsvalue==1)||(($_smarty_tpl->tpl_vars['offerId']->value>0||$_smarty_tpl->tpl_vars['manyParcodes']->value==1)&&$_smarty_tpl->tpl_vars['mysellbilldata']->value->sellbilldiscounttype==2)){?> selected="selected"
                                    <?php }?> value="2"><?php echo @SELL_BILL_PERCENTAGE;?>
</option>
                            </select>
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <div
                        class="form-group mg-bt5 check_tr_discount <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[42]->billsettingsvalue;?>
<?php $_tmp156=ob_get_clean();?><?php if ($_tmp156==1){?>  hidden <?php }?>">
                        <label class="col-lg-5 col-sm-7 control-label"> <?php echo @SELL_BILL_DISCOUNT_VALUE;?>
</label>
                        <div class="col-lg-7 col-sm-5"> <span id="sprytextfield4">
                                <div id="percentageSignDiv" class="input-group">
                                    <input type="text" name="gendis" id="gendis" <?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1){?>value="<?php echo $_smarty_tpl->tpl_vars['mysellbilldata']->value->sellbilldiscount;?>
" <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[57]->billsettingsvalue;?>
<?php $_tmp157=ob_get_clean();?><?php if ($_tmp157!=0){?>value="0"<?php }}?> class="form-control
                                    numberclic positivefloat autoSaveBillMainPart"
                                    placeholder="<?php echo @SELL_BILL_DISCOUNT_VALUE;?>
" autocomplete="off" />
                                    <span class="input-group-addon" id="percentageValSpan">0%</span>
                                    <span class="input-group-addon hide" id="percentageSignSpan">%</span>
                                </div>
                                <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">
                                    <?php echo @SELL_BILL_ENTER_CORRECT_VALUE;?>
</span>
                            </span> </div>
                    </div>
                    <!-- end of form-group-->
                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[90]->billsettingsvalue;?>
<?php $_tmp158=ob_get_clean();?><?php if ($_tmp158==1&&$_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountPlace==0){?>
                    <div>
                        <!--<hr class="mg-tp5 mg-bt5"/>-->
                        <div class="form-group mg-bt5">
                            <label class="col-lg-5 control-label"><?php if ($_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountFixed==1){?>
                                (<?php echo $_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountPer;?>
%) <?php }?> <?php echo @SELL_BILL_EXTRA_DISCOUNT;?>
</label>
                            <div class="col-lg-7">
                                <?php if ($_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountFixed==0){?>
                                <div class="input-group">
                                    <input type="text" name="extraDiscountPer"
                                           class="form-control numberinput positiveNo autoSaveBillMainPart" id="extraDiscountPer"
                                           value="0" />
                                    <span class="input-group-addon">%</span>
                                </div>
                                <?php }else{ ?>
                                <input type="hidden" name="extraDiscountPer" id="extraDiscountPer"
                                       value="<?php echo $_smarty_tpl->tpl_vars['billnameAddData']->value->extraDiscountPer;?>
" />
                                <?php }?>
                                <div class="input-group" style="padding-top: 1px;">
                                    <input type="text" name="extraDiscountVal" class="form-control numberinput positiveNo"
                                           id="extraDiscountVal" value="0" readonly />
                                    <input type="hidden" name="extraDiscountVal_h" id="extraDiscountVal_h" value="0" />
                                    <span class="input-group-addon"><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->currancy;?>
</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php }?>

                    <!-- end of form-group-->
                    <div <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[89]->billsettingsvalue;?>
<?php $_tmp159=ob_get_clean();?><?php if ($_tmp159==0){?> style="display:none" <?php }?>>
                        <hr class="mg-tp5 mg-bt5" />
                        <div class="form-group mg-bt5">
                            <label class="col-lg-5 col-sm-7 control-label"><?php echo @SELL_BILL_TAX_DEDUCTION;?>

                                (<?php echo $_smarty_tpl->tpl_vars['billnameAddData']->value->taxOfDiscountVal;?>
%)</label>
                            <div class="col-lg-7 col-sm-5">
                                <div class="input-group">
                                    <input type="hidden" name="taxOfDiscountPercentage" id="taxOfDiscountPercentage"
                                           value="<?php echo $_smarty_tpl->tpl_vars['billnameAddData']->value->taxOfDiscountVal;?>
" />
                                    <input type="hidden" name="taxOfDiscountVal_h" id="taxOfDiscountVal_h" value="0" />
                                    <input type="text" name="taxOfDiscountVal"
                                           class="form-control numberinput positiveNo autoSaveBillMainPart" id="taxOfDiscountVal"
                                           value="0" readonly />
                                    <span class="input-group-addon"><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->currancy;?>
</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <div <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[31]->billsettingsvalue;?>
<?php $_tmp160=ob_get_clean();?><?php if ($_tmp160==0){?> <?php }else{ ?> style="display:none" <?php }?>>
                        <hr class="mg-tp5 mg-bt5" />
                        <div class="form-group mg-bt5">
                            <label class="col-lg-5 col-sm-7 control-label"> <?php echo @SELL_BILL_VALUE_TAX;?>
</label>
                            <div class="col-lg-7 col-sm-5">
                                <div class="input-group">
                                    <input type="text" name="tax"
                                           class="form-control numberinput positiveNo autoSaveBillMainPart" id="tax"
                                           value="<?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1){?><?php echo $_smarty_tpl->tpl_vars['mysellbilldata']->value->tax;?>
<?php }else{ ?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->vatValue;?>
<?php }?>"
                                           onkeyup="checkdisValue();" />
                                    <span class="input-group-addon">%</span>
                                </div>
                                <div class="input-group" style="padding-top: 1px;">
                                    <input type="text" name="taxVal" class="form-control numberinput positiveNo" id="taxVal"
                                           value="0" readonly />
                                    <span class="input-group-addon"><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->currancy;?>
</span>
                                </div>
                            </div>
                        </div>


                    </div>


                    <hr class="mg-tp5 mg-bt5" />
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[51]->billsettingsvalue;?>
<?php $_tmp161=ob_get_clean();?><?php if ($_tmp161==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-5 col-sm-7 control-label"> <?php echo @SELL_BILL_PURE;?>
</label>
                        <div class="col-lg-7 col-sm-5">
                            <p class="form-control-static mg-tp10" id="gen2total">0</p>
                            <input type="hidden" name="sellbillaftertotalbill" id="sellbillaftertotalbill" value="0" />
                        </div>
                    </div>

                    <!-- end of form-group-->
                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[54]->billsettingsvalue;?>
<?php $_tmp162=ob_get_clean();?><?php if ($_tmp162==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-5 col-sm-7 control-label"> <?php echo @SELL_BILL_PAID;?>
</label>
                        <div class="col-lg-7 col-sm-5">
                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[86]->billsettingsvalue;?>
<?php $_tmp163=ob_get_clean();?><?php if ($_tmp163==0){?>
                            <input type="text" name="genpay" id="genpay" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[37]->billsettingsvalue;?>
<?php $_tmp164=ob_get_clean();?><?php if ($_tmp164==1){?> "
                            <?php }?> class="form-control numberinput positivefloat autoSaveBillMainPart" placeholder="0" value="<?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1){?><?php echo $_smarty_tpl->tpl_vars['mysellbilldata']->value->sellbilltotalpayed;?>
<?php }else{ ?>0<?php }?>"/>
                            <input type="hidden" name="genpayvisa" id="genpayvisa" value="0" />
                            <input type="hidden" name="visaAccount" id="visaAccount" value="0" />
                            <input type="hidden" name="isBankAccountTransfer" id="isBankAccountTransfer" value="0" />
                            <?php }else{ ?>
                            <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[54]->billsettingsvalue;?>
<?php $_tmp165=ob_get_clean();?><?php if ($_tmp165==0){?> <?php }else{ ?>
                                style="display:none" <?php }?>>
                                <label class="col-lg-5 col-sm-7 control-label"><?php echo @SELL_BILL_CASH;?>
 </label>
                                <div class="col-lg-7 col-sm-5">
                                    <input type="text" name="genpay" id="genpay" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[37]->billsettingsvalue;?>
<?php $_tmp166=ob_get_clean();?><?php if ($_tmp166==1){?> " <?php }?> class="form-control numberinput positivefloat autoSaveBillMainPart"
                                    placeholder="0" value="<?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1){?><?php echo $_smarty_tpl->tpl_vars['mysellbilldata']->value->cashPayed;?>
<?php }else{ ?>0<?php }?>"/>
                                </div>
                            </div>
                            <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[54]->billsettingsvalue;?>
<?php $_tmp167=ob_get_clean();?><?php if ($_tmp167==0){?> <?php }else{ ?>
                                style="display:none" <?php }?>>
                                <label
                                    class="col-lg-5 col-sm-7 control-label"><?php echo @SELL_BILL_ELECTRONIC_PAYMENT;?>
</label>
                                <div class="col-lg-7 col-sm-5">
                                    <input type="text" name="genpayvisa" id="genpayvisa" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[37]->billsettingsvalue;?>
<?php $_tmp168=ob_get_clean();?><?php if ($_tmp168==1){?> " <?php }?> class="form-control numberinput
                                    positivefloat autoSaveBillMainPart" placeholder="0" value="<?php if ($_smarty_tpl->tpl_vars['manyParcodes']->value==1){?><?php echo $_smarty_tpl->tpl_vars['mysellbilldata']->value->visaPayed;?>
<?php }else{ ?>0<?php }?>"/>
                                </div>
                            </div>
                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billnameData']->value->defVisaAccountSelect;?>
<?php $_tmp169=ob_get_clean();?><?php if ($_tmp169==0){?>
                            <input type="hidden" name="visaAccount" id="visaAccount" value="<?php echo $_smarty_tpl->tpl_vars['billnameData']->value->defVisaAccount;?>
" />
                            <?php }else{ ?>
                            <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[54]->billsettingsvalue;?>
<?php $_tmp170=ob_get_clean();?><?php if ($_tmp170==0){?> <?php }else{ ?>
                                style="display:none" <?php }?>>
                                <label class="col-lg-5 col-sm-7 control-label"><?php echo @SELL_BILL_PAYMENT_ACCOUNT;?>
</label>
                                <div class="col-lg-7 col-sm-5">
                                    <select class="select2 wds100 autoSaveBillMainPart" name="visaAccount" id="visaAccount">
                                        <option value="0"></option>
                                        <?php  $_smarty_tpl->tpl_vars['acc'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['acc']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['bankAccounts']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['acc']->key => $_smarty_tpl->tpl_vars['acc']->value){
$_smarty_tpl->tpl_vars['acc']->_loop = true;
?>
                                        <option value="<?php echo $_smarty_tpl->tpl_vars['acc']->value->accountid;?>
" <?php if ($_smarty_tpl->tpl_vars['billnameData']->value->defVisaAccount==$_smarty_tpl->tpl_vars['acc']->value->accountid){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['acc']->value->accountname;?>
/<?php echo $_smarty_tpl->tpl_vars['acc']->value->bankname;?>
</option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billnameData']->value->isBankAccountTransfer;?>
<?php $_tmp171=ob_get_clean();?><?php if ($_tmp171==1){?> <?php }else{ ?>
                                style="display:none" <?php }?>>
                                <label class="col-lg-5 col-sm-7 control-label"><?php echo @SELL_BILL_BANK_TRANSFER;?>
 </label>
                                <div class="col-lg-7 col-sm-5">
                                    <input type="checkbox" name="isBankAccountTransfer" id="isBankAccountTransfer"
                                           class="autoSaveBillMainPart" value="1" />
                                </div>
                            </div>

                            <?php }?>
                            <?php }?>
                        </div>
                    </div>
                    <!-- end of form-group-->
                    <hr class="mg-tp5 mg-bt5" />
                    <div class="form-group mg-bt5 bg-yel" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[55]->billsettingsvalue;?>
<?php $_tmp172=ob_get_clean();?><?php if ($_tmp172==0){?> <?php }else{ ?>
                        style="display:none" <?php }?>>
                        <label class="col-lg-5 col-sm-7 control-label"><?php echo @SELL_BILL_RESIDUAL;?>
 </label>
                        <div class="col-lg-7 col-sm-5">
                            <p class="form-control-static mg-tp10" id="gen3total">0</p>
                        </div>
                    </div>
                    <!-- end of form-group-->

                    <div class="form-group mg-bt5" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[1]->billsettingsvalue;?>
<?php $_tmp173=ob_get_clean();?><?php if ($_tmp173==0){?> style="display:block"
                        <?php }else{ ?> style="display:none !important" <?php }?>>
                        <label class="col-lg-5 col-sm-7 control-label"><?php echo @SELL_BILL_REST_DEBT;?>
 </label>
                        <div class="col-lg-7 col-sm-5">
                            <p class="form-control-static mg-tp10" id="gen4total">0</p>
                            <input type="hidden" id="gen4totalinput" value="0" />

                            <input type="hidden" id="clientdebtafter" value="0" />
                        </div>
                    </div>
                    <!-- end of form-group-->
                </div>
                <!-- end of totals center-->
            </div>
            <div class="clearfix"></div>
            <!-- end of fourth row-->
            <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['roundNumbersStatus']->value;?>
" id="round_numbers" />
            <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['noOfDecimalPlaces']->value;?>
" id="noOfDecimalPlaces" />
            <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['previousPriceStatus']->value;?>
" id="previousPriceStatus" />
            <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->roundnumbersbilltotal;?>
" id="roundnumbersbilltotal" />
            <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->noOfDecimalPlacesBillTotal;?>
" id="noOfDecimalPlacesBillTotal" />
            <div class="row text-center">
                <button type="button" id="saveBill" onclick="return addDataOnly();"
                        class="btn btn-primary"><?php echo @SELL_BILL_SAVE;?>
</button>
                <button type="button" id="saveAndNew" onclick="return addDataAndReturn();"
                        class="btn btn-success"><?php echo @SELL_BILL_SAVE_NEW;?>
</button>
                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['billsettingsData']->value[94]->billsettingsvalue;?>
<?php $_tmp174=ob_get_clean();?><?php if ($_tmp174==0){?>
                <button type="button" id="saveAndPrint" onclick="return addDataAndPrint();"
                        class="btn btn-success"><?php echo @SELL_BILL_SAVE_PRINT;?>
</button>
                <?php }?>
                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->sellorder==1){?>
                <button type="button" id="saveAndNewOrder" onclick="return addDataAndReturnOrder();"
                        class="btn btn-success"><?php echo @SELL_BILL_SAVE_NEW_ORDER;?>
</button>
                <?php }?>
                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->ebill==1&&$_smarty_tpl->tpl_vars['billsettingsData']->value[106]->billsettingsvalue==0){?>
                <button type="button" id="saveAndSend" onclick="return addDataAndSend();" class="btn btn-success">حفظ
                    وارسال</button>
                <?php }?>


                <!-- <button type="button" onclick="printData();" class="btn btn-info">طباعة</button>-->
            </div>
            <br />
            <div class="row">
                <style>
                    .unsufficient {
                        background-color: #f59a99 !important;
                    }

                    .note-warning {
                        background-color: #faeaa9;
                        border-color: #f3cc31;
                        color: #000;
                        border-right: 5px solid #f3cc31;
                        border-radius: 4px 0 0 4px;
                        margin: 0 0 20px;
                        padding: 15px 15px 15px 30px;
                    }
                </style>
                <input type="hidden" id="storenegative" value="<?php echo $_smarty_tpl->tpl_vars['storenegative']->value;?>
" />
                <div class="note-warning" style="display: none" id="check_store_div">
                    <h4 class="block" id="check_store_msg"></h4>
                </div>
            </div>
            <!-- end of fifth row-->

        </form>
    </div>
</div>
<!-- end of container-->
<!-- end of main row-->

<!------------------------Client Model----------------------------->
<!-- Modal -->
<div class="modal fade" id="myModal1" 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"><?php echo @CLIENT_ADD_CLIENT;?>
</h4>
            </div>
            <div class="modal-body">
                <form id="clientInfo" action="#" method="post" class="form-horizontal">
                    <input type="hidden" name="returnToselect2Ajax" value="1" />
                    <div class="form-group">
                        <label for="newclientName"
                               class="col-lg-2 control-label"><?php echo @SELL_BILL_CLIENT_NAME;?>
</label>
                        <div class="col-lg-4"> <span id="sprytextfield2">
                                <input class="form-control" placeholder="<?php echo @SELL_BILL_CLIENT_NAME;?>
"
                                       id="newclientName" name="newclientName" type="text" required="required" />
                                <span class="textfieldRequiredMsg">*</span></span>
                            <div id="nameError" class="alert alert-block alert-danger fade in" style="display:none">
                                <button type="button" class="close pull-left" data-dismiss="alert"
                                        aria-hidden="true">&times;</button>
                                <h4><?php echo @CLIENT_WRONG_MESSAGE;?>
</h4>
                                <p><?php echo @CLIENT_THAT_NAME_ALREADY_TAKEN;?>
</p>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                    </div>




                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->simpleAddClientInBill!=1){?>style="display:none"<?php }?>>
                        <label for="clientaddress"
                               class="col-lg-2 control-label"><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->clientcodname;?>
</label>
                        <div class="col-lg-4">
                            <input class="form-control" placeholder="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->clientcodname;?>
"
                                   id="clientcode" name="clientcode" type="text" />
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="txtAddress"
                               class="col-lg-2 control-label"><?php echo @CLIENT_COMPANY_REGION;?>
</label>
                        <div class="col-lg-4">
                            <span id="spryselect1">
                                <input <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientfieldrequired==1){?> required="required" <?php }?>
                                type="hidden" name="clientareaid" value="0" id="clientareaid"/>
                                <span
                                    class="selectInvalidMsg"><?php echo @CLIENT_SELECT_COMPANY_REGION;?>
</span></span>

                        </div>
                    </div>
                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->simpleAddClientInBill!=1){?>style="display:none"<?php }?>>
                        <label for="taxnumber" class="col-lg-2 control-label">الرقم الضريبى</label>
                        <div class="col-lg-4">
                            <span id="spryselect1">
                                <input class="form-control" type="text" name="taxnumber" placeholder="الرقم الضريبى"
                                       id="taxnumber">
                                <span class="selectInvalidMsg"></span></span>

                        </div>
                    </div>



                    <!--<div class="form-group">-->
                    <!--<label for="txtAddress" class="col-lg-2 control-label">اسم الشركة</label>-->
                    <!--<div class="col-lg-4">-->

                    <!--<select name="clientareaid" id="clientareaid"  data-placeholder="اختر الشركة" class="select2 wdt100">-->
                    <!--<option value="0">اختر </option>-->
                    <!--<?php  $_smarty_tpl->tpl_vars['myallclientarea'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['myallclientarea']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allclientarea']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['myallclientarea']->key => $_smarty_tpl->tpl_vars['myallclientarea']->value){
$_smarty_tpl->tpl_vars['myallclientarea']->_loop = true;
?>-->
                    <!--<option value="<?php echo $_smarty_tpl->tpl_vars['myallclientarea']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['myallclientarea']->value->name;?>
 </option>-->
                    <!--<?php } ?>-->
                    <!--</select>-->

                    <!--</div>-->
                    <!--</div>-->
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="newclientdebt"
                               class="col-lg-2 control-label"><?php echo @CLIENT_INDEBTEDNESS;?>
</label>
                        <div class="col-lg-4"> <!--<span id="sprytextfield3">-->
                            <input class="form-control numberinput" placeholder="<?php echo @CLIENT_INDEBTEDNESS;?>
"
                                   id="newclientdebt" name="newclientdebt" type="text" required="required" />
                            <!--<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">ادخل المديونية صحيحة</span></span>-->
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="clientaddress" class="col-lg-2 control-label"><?php echo @CLIENT_ADDRESS;?>
</label>
                        <div class="col-lg-4">
                            <input class="form-control" placeholder="<?php echo @CLIENT_ADDRESS;?>
" id="clientaddress"
                                   name="clientaddress" type="text" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="clientphone"
                               class="col-lg-2 control-label"><?php echo @SELL_BILL_PHONE_NUMBER;?>
</label>
                        <div class="col-lg-4">
                            <input class="form-control numberinput" placeholder="<?php echo @SELL_BILL_PHONE_NUMBER;?>
"
                                   id="clientphone" name="clientphone" type="text" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="clientmobile"
                               class="col-lg-2 control-label"><?php echo @CLIENT_MOBILE_NUMBER;?>
</label>
                        <div class="col-lg-4">
                            <input class="form-control numberinput" placeholder="<?php echo @CLIENT_MOBILE_NUMBER;?>
"
                                   id="clientmobile" name="clientmobile" type="text" />
                        </div>
                    </div>
                    <div class="form-group ">
                        <label class="col-lg-2 control-label">المندوب </label>
                        <div class="col-lg-4">
                            <span>
                                <select name="delegateid" id="delegateid" data-placeholder="اختر "
                                        class="select2 wdt100">


                                    <option value="-1">اختر </option>
                                    <?php  $_smarty_tpl->tpl_vars['delegate'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['delegate']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDelegate']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['delegate']->key => $_smarty_tpl->tpl_vars['delegate']->value){
$_smarty_tpl->tpl_vars['delegate']->_loop = true;
?>
                                    <option value="<?php echo $_smarty_tpl->tpl_vars['delegate']->value['userid'];?>
"><?php echo $_smarty_tpl->tpl_vars['delegate']->value['employeename'];?>
</option>
                                    <?php } ?>
                                </select>
                                <!--<span class="selectInvalidMsg">اختر المحافظة</span>-->
                            </span>

                        </div>
                    </div>
                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->simpleAddClientInBill!=1){?>style="display:none"<?php }?>>
                        <label for="debtLimit" class="col-lg-2 control-label"><?php echo @CLIENT_DEBT_LIMIT;?>
 </label>
                        <div class="col-lg-4">
                            <input type="text" name="debtLimit" class="form-control positivefloat" id="debtLimit"
                                   value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->clientDefaultDebtLimit;?>
">
                        </div>
                    </div>
                    <!-- =================================================   -->

                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->simpleAddClientInBill!=1){?>style="display:none"<?php }?>>
                        <label class="col-lg-2 control-label"><?php echo @CLIENT_SPECIAL_DISCOUNT;?>
 </label>
                        <div class="col-lg-1">
                            <input type="checkbox" name="specialDiscount" id="specialDiscount" value="1" />
                        </div>
                        <div style="display: none" id="specialDiscountVal_div">
                            <label class="col-lg-1 control-label"><?php echo @CLIENT_RATIO;?>
 </label>
                            <div class="col-lg-2">
                                <input type="text" name="specialDiscountVal" id="specialDiscountVal"
                                       class="form-control positivefloat" placeholder="" value="" />
                            </div>
                        </div>
                    </div>

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

                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->simpleAddClientInBill!=1){?>style="display:none"<?php }?>>
                        <label class="col-lg-2 control-label"><?php echo @CLIENT_CARD_IMAGE;?>
</label>
                        <div class="col-lg-4">
                            <input type="file" name="file" id="file" />
                        </div>
                    </div>


                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="clientdetails" class="col-lg-2 control-label"><?php echo @CLIENT_COMMENT;?>
</label>
                        <div class="col-lg-4">
                            <textarea class="form-control" rows="3" name="clientdetails" id="clientdetails"></textarea>
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> <?php echo @SELL_BILL_PRICE_TYPE;?>
</label>
                        <div class="col-lg-4">
                            <span>
                                <select name="priceTypeId" id="priceTypeId"
                                        data-placeholder=" <?php echo @SELL_BILL_SELECT;?>
" class="select2 wdt100">
                                    <option value="-1"><?php echo @CLIENT_CHOOSE_PRICE_TYPE;?>
</option>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
                                    <option value="0"><?php echo @SELL_BILL_WHOLESALE;?>
</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
                                    <option value="1"><?php echo @SELL_BILL_RETAIL;?>
</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
                                    <option value="2"><?php echo @SELL_BILL_HALF_WHOLESALE;?>
</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
                                    <option value="4"><?php echo @SELL_BILL_PRICE4;?>
</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
                                    <option value="5"><?php echo @SELL_BILL_PRICE5;?>
</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
                                    <option value="6"><?php echo @SELL_BILL_PRICE6;?>
</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
                                    <option value="7"><?php echo @SELL_BILL_PRICE7;?>
</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
                                    <option value="8"><?php echo @SELL_BILL_PRICE8;?>
</option>
                                    <?php }?>
                                </select>
                                <!--<span class="selectInvalidMsg">اختر المحافظة</span>-->
                            </span>

                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->simpleAddClientInBill!=1){?>style="display:none"<?php }?>>
                        <label for="textDetails" class="col-lg-2 control-label"><?php echo @SELL_BILL_STORE;?>
</label>
                        <div class="col-lg-3">
                            <label>
                                <input type="checkbox" class="ckstore" name="store_all" id="store_all" checked="checked"
                                       value="1" />
                                <?php echo @CLIENT_ALL_STORES;?>

                            </label>
                        </div>
                        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->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;
?>
                        <div class="col-lg-3">
                            <label>
                                <input type="checkbox" class="clientStore ckstore" name="store<?php echo $_smarty_tpl->tpl_vars['data']->value->storeId;?>
"
                                       id="store<?php echo $_smarty_tpl->tpl_vars['data']->value->storeId;?>
" checked="checked" disabled="disabled" value="1" />
                                <?php echo $_smarty_tpl->tpl_vars['data']->value->storeName;?>

                            </label>
                        </div>
                        <?php } ?>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->simpleAddClientInBill!=1){?>style="display:none"<?php }?>>
                        <label for="texttype"
                               class="col-lg-2 control-label"><?php echo @CLIENT_CUSTOMER_TYPE;?>
</label>
                        <div class="col-lg-3">
                            <label>
                                <input type="checkbox" class="cktype" name="typeClient_all" id="typeClient_all"
                                       checked="checked" value="1" />
                                <?php echo @CLIENT_ALL_CUSTOMER_TYPE;?>

                            </label>
                        </div>
                        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['typeClient']->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;
?>
                        <div class="col-lg-3">
                            <label>
                                <input type="checkbox" class="typeClient cktype" name="type<?php echo $_smarty_tpl->tpl_vars['data']->value->typeId;?>
"
                                       id="type<?php echo $_smarty_tpl->tpl_vars['data']->value->typeId;?>
" checked="checked" value="1" />
                                <?php echo $_smarty_tpl->tpl_vars['data']->value->typeName;?>

                            </label>
                        </div>
                        <?php } ?>
                    </div>
                    <!-- =================================================   -->
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default savemodel2"
                        data-dismiss="modal"><?php echo @CLIENT_NO;?>
</button>
                <button type="button" class="btn btn-primary savemodel1"><?php echo @CLIENT_YES;?>
</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

<!------------------------Client Model----------------------------->
<!-- 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"><?php echo @BARCODE_ADD_PRODUCTS_COMBINED_BARCODE;?>
</h4>
            </div>
            <div class="modal-body">
                <form id="manyParcodesForm" action="sellbillController.php?do=addsellBillManyParcodes" method="post"
                      class="form-horizontal">
                    <div class="form-group">
                        <label for="debtLimit"
                               class="col-lg-3 control-label"><?php echo @BARCODE_COLLECTED_BARCODE;?>
</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="manyParcodesSupplier" id="manyParcodesSupplier" value="" />
                    <input type="hidden" name="manyParcodesPriceType" id="manyParcodesPriceType" value="" />
                    <input type="hidden" name="manyParcodesStoreid" id="manyParcodesStoreid" value="" />
                    <input type="hidden" name="manyParcodesSellerid" id="manyParcodesSellerid" value="" />
                    <input type="hidden" name="manyParcodesSaveid" id="manyParcodesSaveid" value="" />
                    <input type="hidden" name="addManyParcodesType" id="addManyParcodesType" value="" />
                    <input type="hidden" name="addManyParcodebillnameid" id="addManyParcodebillnameid" value="" />
                    <input type="hidden" name="addManyParcodebilloperationid" id="addManyParcodebilloperationid"
                           value="" />
                    <input type="hidden" name="addManyParcodeobgyBillType" id="addManyParcodeobgyBillType" value="" />
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default savemodel2"
                        data-dismiss="modal"><?php echo @BARCODE_CANCEL;?>
</button>
                <button type="button" class="btn btn-primary"
                        id="doAddManyParcodes"><?php echo @BARCODE_COMPLETED;?>
</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

<!------------------------Client Model----------------------------->
<!-- Modal -->
<div class="modal fade" id="productDetailsModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title"><?php echo @PRODUCT_DETAILS;?>
</h4>
            </div>
            <div class="modal-body">
                <form id="productDetailsForm" class="form-horizontal">

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal"><?php echo @PRODUCT_CLOSE;?>
</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

<!------------------------Client Model----------------------------->
<!-- Modal -->
<div class="modal fade" id="oldAutoSaveBillDataModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog" style="width: 85%;">
        <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="oldAutoSaveBillDataForm" class="form-horizontal">

                </form>
                <form id="oldAutoSaveBillActionForm">
                    <div class="form-group">
                        <label class="col-lg-1 control-label">المطلوب </label>
                        <div class="radio-inline">
                            <label> <input value="1" name="autoSaveOldBillAction" id="autoSaveOldBillAction0"
                                           type="radio" checked>
                                استخدام منتجات الفاتورة الحاليه والغاء السابقه</label>
                        </div>
                        <br />
                        <label class="col-lg-1 control-label"></label>
                        <div class="radio-inline">
                            <label> <input value="2" name="autoSaveOldBillAction" id="autoSaveOldBillAction1"
                                           type="radio">
                                استخدام منتجات الفاتورة السابقه والغاء الحالية</label>
                        </div>
                        <br />
                        <label class="col-lg-1 control-label"></label>
                        <div class="radio-inline">
                            <label> <input value="3" name="autoSaveOldBillAction" id="autoSaveOldBillAction2"
                                           type="radio">
                                دمج منتجات كلا الفاتورتين</label>
                        </div>
                    </div>
                </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 autoSaveOldBillActionBtn">متابعه</button>

            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

<!------------------------Product Model----------------------------->

<!-- Modal -->
<div class="modal fade" id="productModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog"><!-- style="width: 910px;" -->
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-left savemodel3" data-dismiss="modal"
                        aria-hidden="true">&times;</button>
                <h4 class="modal-title"><?php echo @PRODUCT_ADD_PRODUCT;?>
</h4>
            </div>
            <div class="productForm">
                <div class="modal-body ">
                    
                    <form id="productInfo" action="#" method="post" class="nameToBeChecked form-horizontal" onsubmit="if (Spry.Widget.Form.validate(this)) {
                                checkName(event, 'product', 'productName');
                                insertProduct(event);
                            } else {
                                return false;
                            }">
                        
                        <div class="form-group">
                            <label for="productCatId"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_MAIN_CLASSIFICATION;?>
</label>
                            <div class="col-lg-4"><span id="spryselect1">
                                    <input type="hidden" name="productAddMultiCatLevel" id="productAddMultiCatLevel"
                                           value="1" />
                                    <select name="productCatId" id="productCatId0" data-level="0"
                                            class="select2 wdt100 productCat">
                                        <option value="-1"><?php echo @PRODUCT_CHOOSE_RATING;?>
</option>
                                        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['catDataReport']->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>

                                    <input type="hidden" id="level" name="level" value="0">
                                    <span class="selectInvalidMsg">*</span></span></div>
                            <div id="manyParents" class="col-lg-12"> </div>
                            <span class="selectInvalidMsg">*</span>

                        </div>
                        <!---------------------------->

                        <input name="hide_precentage" id="hide_precentage" type="hidden"
                               value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->precentages;?>
" />
                        <input name="hide_realprice" id="hide_realprice" type="hidden"
                               value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->realprice;?>
" />

                        <div class="form-group">
                            <label for="productName" class="col-lg-2 control-label"><?php echo @PRODUCT_NAME;?>
</label>
                            <div class="col-lg-4"> <span id="sprytextfield1">
                                    <input name="productName" type="text" id="productName" size="50"
                                           class=" form-control " />
                                    <span class="textfieldRequiredMsg">*</span></span>
                                <div id="productnameError" class="alert alert-block alert-danger fade in"
                                     style="display:none">
                                    <button type="button" class="close pull-left" data-dismiss="alert"
                                            aria-hidden="true">&times;</button>
                                    <h4><?php echo @CLIENT_WRONG_MESSAGE;?>
</h4>
                                    <p><?php echo @CLIENT_THAT_NAME_ALREADY_TAKEN;?>
</p>
                                    <div class="clearfix"></div>
                                </div>
                            </div>
                        </div>
                        <!---------------------------->

                        <div class="form-group check_tr " <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp175=ob_get_clean();?><?php if ($_tmp175==1){?> style="display:none;"
                            <?php }?> >
                            <label for="parcode"
                                   class="col-lg-2 control-label"><?php echo @SELL_BILL_BARCODE;?>
</label>
                            <div class="col-lg-4">
                                <input name="parcode" type="text" id="parcode" class=" form-control" size="50" />
                            </div>
                        </div>
                        <!---------------------------->

                        <div class="form-group">
                            <label for="productBuyPrice"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_PURCHASING_PRICE;?>
</label>
                            <div class="col-lg-4"> <span id="sprytextfield5">
                                    <input name="productBuyPrice" type="text" id="productBuyPrice1"
                                           class="numberinput positivefloat buy_price form-control" data-id="1"
                                           size="50" />
                                    <span class="textfieldRequiredMsg">*</span><span
                                        class="textfieldInvalidFormatMsg"><?php echo @PRODUCT_ENTER_CORRECT_PRICE;?>
</span></span>
                            </div>
                        </div>
                        <!---------------------------->


                        <div class="form-group" style="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->realprice;?>
<?php $_tmp176=ob_get_clean();?><?php if ($_tmp176==1){?> display: none; <?php }?>">
                            <label for="productBuyPrice"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_ACTUAL_PURCHASR_PRICE;?>
</label>
                            <div class="col-lg-4"> <span id="sprytextfield5">
                                    <input style="width: 50%;float: left;" name="productbuypricereal" type="text"
                                           id="buypricereal1" data-type="pricereal"
                                           class="form-control prices  aw_m aw_mt aw_pp numberclic enteraction  numberinput positivefloat buy_pricereal1"
                                           data-id="1" width="10" /></span>
                                <input style="  width: 50%;" name="buypricereal_precentage1" type="text"
                                       id="productBuyPrice1" data-type="pricereal"
                                       class="form-control precentages  aw_m aw_mt aw_pp numberclic enteraction  numberinput positivefloat buypricereal_precentage1"
                                       data-id="1" width="10" />
                                <span class="textfieldRequiredMsg">*</span><span
                                    class="textfieldInvalidFormatMsg"><?php echo @PRODUCT_ENTER_CORRECT_PRICE;?>
</span></span>
                            </div>
                        </div>
                        <!---------------------------->
                        <div class="form-group">
                            <label for="productSellAllPrice"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_WHOLESALE_PRICE;?>
</label>
                            <div class="col-lg-4"> <span id="sprytextfield6">
                                    <!--<input name="productSellAllPrice" type="text" id="productSellAllPrice" class="numberinput form-control" onkeyup="populateSellPrice();"  size="50"   />-->
                                    <input
                                        style="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->precentages;?>
<?php $_tmp177=ob_get_clean();?><?php if ($_tmp177==1){?> width: 100%; <?php }else{ ?> width: 50%; <?php }?> float: left;"
                                        name="productSellAllPrice" type="text" id="productSellAllPrice"
                                        data-type="buytotal"
                                        class="form-control prices aw_m aw_mt aw_pp numberclic positivefloat buy_total1 enteraction numberinput"
                                        data-id="1" width="10" />
                                    <input
                                        style="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->precentages;?>
<?php $_tmp178=ob_get_clean();?><?php if ($_tmp178==1){?> display: none; <?php }?>  width: 50%;"
                                        name="buytotal_precentage1" type="text" id="productBuyPrice1"
                                        data-type="buytotal"
                                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction precentages numberinput positivefloat buytotal_precentage1"
                                        data-id="1" width="10" />
                                    <span class="textfieldRequiredMsg">*</span><span
                                        class="textfieldInvalidFormatMsg"><?php echo @PRODUCT_ENTER_CORRECT_PRICE;?>
</span></span>
                            </div>
                        </div>
                        <!---------------------------->

                        <div class="form-group">
                            <!--<label for="productSellHalfPrice" class="col-lg-2 control-label">سعر بيع الجمله التجزئة</label>-->
                            <label for="productSellHalfPrice"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_HALF_WHOLESALE_PRICE;?>
 </label>
                            <div class="col-lg-4"> <span id="sprytextfield7">
                                    <!--<input name="productSellHalfPrice" type="text" id="productSellHalfPrice" class=" form-control numberinput"   size="50"   />-->
                                    <input
                                        style="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->precentages;?>
<?php $_tmp179=ob_get_clean();?><?php if ($_tmp179==1){?> width: 100%; <?php }else{ ?> width: 50%; <?php }?>float: left;"
                                        name="productSellHalfPrice" type="text" data-type="buyhalf"
                                        id="productSellHalfPrice"
                                        class="form-control  aw_m aw_mt aw_pp numberclic prices enteraction numberinput positivefloat buy_hafe1"
                                        data-id="1" width="10" />
                                    <input
                                        style=" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->precentages;?>
<?php $_tmp180=ob_get_clean();?><?php if ($_tmp180==1){?> display: none; <?php }?> width: 50%;"
                                        name="buyhalf_precentage1" type="text" id="productBuyPrice1" data-type="buyhalf"
                                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction  precentages numberinput positivefloat buyhafe_precentage1"
                                        data-id="1" width="10" />
                                    <span class="textfieldRequiredMsg">*</span><span
                                        class="textfieldInvalidFormatMsg"><?php echo @PRODUCT_ENTER_CORRECT_PRICE;?>
</span></span>
                            </div>
                        </div>
                        <!---------------------------->

                        <div class="form-group">
                            <!--<label for="productSellUnitPrice" class="col-lg-2 control-label">سعر بيع الوحده</label>-->
                            <label for="productSellUnitPrice"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_RETAIL_PRICE;?>
</label>
                            <div class="col-lg-4"> <span id="sprytextfield8">
                                    <!--<input name="productSellUnitPrice" type="text" id="productSellUnitPrice" class=" form-control numberinput"  size="50"   />-->
                                    <input
                                        style="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->precentages;?>
<?php $_tmp181=ob_get_clean();?><?php if ($_tmp181==1){?> width: 100%; <?php }else{ ?> width: 50%; <?php }?> float: left;"
                                        name="productSellUnitPrice" type="text" data-type="buypart"
                                        id="productSellUnitPrice"
                                        class="form-control  aw_m aw_mt aw_pp numberclic prices enteraction numberinput positivefloat buy_part1"
                                        data-id="1" width="20" />
                                    <input
                                        style=" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->precentages;?>
<?php $_tmp182=ob_get_clean();?><?php if ($_tmp182==1){?> display: none; <?php }?> width: 50%;"
                                        name="buypart_precentage1" type="text" id="productBuyPrice1" data-type="buypart"
                                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction precentages numberinput positivefloat buypart_precentage1"
                                        data-id="1" width="10" />
                                    <span class="textfieldRequiredMsg">*</span><span
                                        class="textfieldInvalidFormatMsg"><?php echo @PRODUCT_ENTER_CORRECT_PRICE;?>
</span></span>
                            </div>
                        </div>
                        <!---------------------------->

                        <div class="form-group">
                            <label for="inputEmail1"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_QUANTITY;?>
</label>
                            <div class="col-lg-4"> <span id="sprytextfield9">
                                    <input name="new_productquantity" type="text" id="new_productquantity"
                                           class=" form-control numberinput" value="0" size="50" />
                                    <span class="textfieldRequiredMsg">*</span><span
                                        class="textfieldInvalidFormatMsg"><?php echo @PRODUCT_ENTER_CORRECT_QUANTITY;?>
</span></span>
                            </div>
                        </div>

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

                        <div class="form-group check_tr_limitamount " <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->limitamount;?>
<?php $_tmp183=ob_get_clean();?><?php if ($_tmp183==1){?>
                            style="display:none;" <?php }?>>
                            <label for="limitamount"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_MAXIMUM;?>
</label>
                            <div class="col-lg-4"> <span id="sprytextfield10">
                                    <input name="limitamount" type="text" id="limitamount"
                                           class=" form-control numberinput" size="50" />
                                    <span class="textfieldRequiredMsg">*</span><span
                                        class="textfieldInvalidFormatMsg"><?php echo @PRODUCT_ENTER_CORRECT_QUANTITY;?>
</span></span>
                            </div>
                        </div>



                        <!---------------------------->
                        <div class="form-group ">
                            <label for="inputEmail1"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_IN_MENU;?>
</label>
                            <div class="col-lg-4">



                                <label>
                                    <input value="0" class="radioR" name="inMenu1" checked="checked" type="radio" />

                                    <?php echo @CLIENT_YES;?>
 </label>

                                <label>
                                    <input value="1" class="noradioR" name="inMenu1" type="radio" />
                                    <?php echo @CLIENT_NO;?>
 </label>



                            </div>
                        </div>
                        <!---------------------------->
                        <div class="form-group check_tr_production " <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->production;?>
<?php $_tmp184=ob_get_clean();?><?php if ($_tmp184==1){?>
                            style="display:none;" <?php }?>>
                            <label for="inputEmail1"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_MANUFACTURING;?>
</label>
                            <div class="col-lg-4">



                                <label>
                                    <input value="1" class="radioR" name="type1" type="radio" />

                                    <?php echo @CLIENT_YES;?>
 </label>

                                <label>
                                    <input value="0" class="noradioR" name="type1" checked="checked" type="radio" />
                                    <?php echo @CLIENT_NO;?>
 </label>



                            </div>
                        </div>
                        <!---------------------------->


                        <div class="form-group check_tr_service " <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->service;?>
<?php $_tmp185=ob_get_clean();?><?php if ($_tmp185==1){?>
                            style="display:none;" <?php }?>>
                            <label for="inputEmail1"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_SERVICE;?>
</label>
                            <div class="col-lg-4">

                                <label class='color-black'>
                                    <input value="1" class="radioR isservice" name="isservice1" type="radio" />
                                    <?php echo @CLIENT_YES;?>
 </label>

                                <label class='color-black'>
                                    <input value="0" class="noradioR isservice" name="isservice1" checked="checked"
                                           type="radio" />
                                    <?php echo @CLIENT_NO;?>
 </label>
                            </div>

                        </div>

                        <div class="form-group check_tr_date " <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->date;?>
<?php $_tmp186=ob_get_clean();?><?php if ($_tmp186==1){?>
                            style="display:none;" <?php }?>>
                            <label for="productDate" class="col-lg-2 control-label"><?php echo @PRODUCT_DATE;?>
</label>
                            <div class="col-lg-4"> <span id="sprytextfield11">
                                    <input name="productDate" type="text" id="productDate" value="<?php echo $_smarty_tpl->tpl_vars['today']->value;?>
"
                                           class=" form-control awdatepicker" autocomplete="off"
                                           data-date-format="yyyy-mm-dd" size="50" />
                                    <span class="textfieldRequiredMsg">*</span></span></div>
                        </div>
                        <!---------------------------->

                        <div class="form-group check_tr_period " <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->expiredate;?>
<?php $_tmp187=ob_get_clean();?><?php if ($_tmp187==1){?>
                            style="display:none;" <?php }?>>
                            <label for="productDate"
                                   class="col-lg-2 control-label"><?php echo @PRODUCT_EXPIRY_PERIOD;?>
</label>
                            <div class="col-lg-4"> <span id="sprytextfield11">
                                    <input style="width: 83%;" name="expireDate" type="text" id="expireDate" value="0"
                                           class=" form-control numberinput" size="50" />
                                    <span
                                        style="float: left;margin-top: -27px; color: white;font-size: 15px;font-weight: bold;"><?php echo @PRODUCT_DAY;?>
</span>
                                    <span class="textfieldRequiredMsg">*</span></span></div>
                        </div>
                        <!--------------------------------  adding units   ----------------------------->

                        <div class="row check_tr_mesurunit " <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->measuringunit;?>
<?php $_tmp188=ob_get_clean();?><?php if ($_tmp188==1){?>
                            style="display:none;" <?php }?>>
                            <div class="row">
                                <hr />
                                <div class="col-lg-6">
                                    <h4><?php echo @PRODUCT_MEASUREMENT_UNITS;?>
</h4>
                                </div>
                                <div class="col-lg-6">
                                    <button type="button" name="addrawUnit" id="addrawUnit"
                                            class="btn btn-primary pull-left ft-nor"><?php echo @PRODUCT_ADD_UNITS;?>

                                    </button>
                                </div>
                            </div>
                            <!-- end of title row-->
                            <div class="table-responsive">
                                <table class="table billtable table-bordered" id="containerUnit">
                                    <thead>
                                        <tr>
                                            <th class="wdt120"><?php echo @PRODUCT_MEASRUING_UNITS;?>
</th>
                                            <th class="wdt120"><?php echo @PRODUCT_NUMBER_UNITS;?>
</th>
                                            <!--                                            <th class="wdt120">الباركود</th>
                                                                                        <th class="wdt120">سعر الجملة</th>
                                                                                        <th class="wdt120">سعر نص جملة</th>
                                                                                        <th class="wdt120">سعر قطاعى</th>-->
                                            <th>حذف
                                                <input name="unitsItr" id="unitsItr" type="hidden" value="1" />
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>
                                                <select name="newunitid1" id="newunitid1" class="select2 wdt100">




                                                    <?php  $_smarty_tpl->tpl_vars['unit'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['unit']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['unitsData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['unit']->key => $_smarty_tpl->tpl_vars['unit']->value){
$_smarty_tpl->tpl_vars['unit']->_loop = true;
?>


                                                    <option value="<?php echo $_smarty_tpl->tpl_vars['unit']->value->unitId;?>
"><?php echo $_smarty_tpl->tpl_vars['unit']->value->unitName;?>
</option>


                                                    <?php } ?>


                                                </select>
                                            </td>
                                            <td>
                                                <input type="text" name="newproductnumber1" id="newproductnumber1"
                                                       class="form-control txt-nonraduis numberinput" value="1" />
                                            </td>
                                            <!--                                            <td>
                                                                                            <input type="text" name="proUnitParcode1" id="proUnitParcode1"  class="form-control txt-nonraduis numberinput positiveNo" onblur="checkUnitbarcode(this.value, 1);" value="" />
                                                                                        </td>
                                                                                        <td>
                                                                                            <input type="text" name="proUnitSellAllPrice1" id="proUnitSellAllPrice1"  class="form-control txt-nonraduis numberinput positivefloat" value="" />
                                                                                        </td>
                                                                                        <td>
                                                                                            <input type="text" name="proUnitSellHalfPrice1" id="proUnitSellHalfPrice1"  class="form-control txt-nonraduis numberinput positivefloat" value="" />
                                                                                        </td>
                                                                                        <td>
                                                                                            <input type="text" name="proUnitSellUnitPrice1" id="proUnitSellUnitPrice1"  class="form-control txt-nonraduis numberinput positivefloat" value="" />
                                                                                        </td>-->
                                            <td>
                                                <button type="button" id="removeUnit1" class="close flt-none removeUnit"
                                                        aria-hidden="true">&times;</button>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default savemodel3"
                            data-dismiss="modal"><?php echo @CLIENT_NO;?>
</button>
                    <button type="submit" class="btn btn-primary"><?php echo @CLIENT_YES;?>
</button>
                </div>
                </form>
            </div>
            <!-- /.productForm -->
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

<!-- /////////////////////////Store Model/////////////////////////////////-->

<!-- Modal -->
<div class="modal fade" id="storemodel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                <span style="font-weight:bold"><?php echo @STORE_QUANTITY_AVAILABLE_STOCK;?>
</span>
            </div>
            <div class="modal-body"> <?php echo @STORE_ENOUGH_QUANTITY_STOCK;?>
<br />
                <?php echo @STORE_QUANTITY_STOCK;?>
<span id="errorquantity"></span> </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal"><?php echo @PRODUCT_CLOSE;?>
</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<input type="hidden" id="allowBillDelete" value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->allowBillDelete;?>
" />
<!------------------------Client Model----------------------------->
<!-- Modal -->
<div class="modal fade" id="ckPassModal" 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"><?php echo @PERMISSION_DELETE;?>
</h4>
            </div>
            <div class="modal-body">
                <form id="clientInfo2" action="#" method="post" class="form-horizontal">
                    <div class="form-group">
                        <label for="newclientName"
                               class="col-lg-4 control-label"><?php echo @PERMISSION_PASSWORD_CONTINUE;?>
</label>
                        <div class="col-lg-4">
                            <input class="form-control" id="pass" name="pass" type="password" required="required" />
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <input type="hidden" id="delBtnId" value="" />
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default"
                        data-dismiss="modal"><?php echo @BARCODE_CANCEL;?>
</button>
                <button type="button" class="btn btn-primary"
                        id="ckPassDel"><?php echo @PERMISSION_CONTINUE;?>
</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ======================= accountstree Modal Box =========== -->
<!-- Modal -->
<div class="modal fade" id="drinkDetailsModal" tabindex="-1" role="dialog" aria-labelledby="drinkDetailsModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">
                    <label>تفاصيل </label>
                </h4>
            </div>
            <div class="modal-body">
                <form id="drinkDetailsInfo" action="#" method="post" class="form-horizontal">

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default closeAccountsTreeForm" id="cancel"
                        data-dismiss="modal">اغلاق</button>
                <button type="button" id="insert" class="btn btn-primary saveDrinkDetails">حفظ</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ============================================= -->
<form id="tempForm" class="hidden"></form>

<script type="text/javascript">
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "real");
    var billReservationDatesp = null;
    if ($('#billsettingsData_80').val() == "0") {
        var sprytextfield12 = new Spry.Widget.ValidationTextField("sprytextfield12", "real");
    }
    $('#store_all').live('click', function () {
        if ($(this).attr('checked') == 'checked') {
            $('.clientStore').attr('checked', 'checked');
            $('.clientStore').attr('disabled', 'disabled');
        } else {
            $('.clientStore').removeAttr('checked');
            $('.clientStore').removeAttr('disabled');
        }
    });
    $('#typeClient_all').live('click', function () {
        if ($(this).attr('checked') == 'checked') {
            $('.typeClient').attr('checked', 'checked');
            $('.typeClient').attr('disabled', 'disabled');
        } else {
            $('.typeClient').removeAttr('checked');
            $('.typeClient').removeAttr('disabled');
        }
    });
    $('#billReservation').live('change', function () {
        if ($('#billReservation').is(':checked')) {
            billReservationDatesp = new Spry.Widget.ValidationTextField("billReservationDatesp");
        } else {
            billReservationDatesp.resetClasses(); //.reset();   //Resets any validation css on the form
            billReservationDatesp.destroy();
            billReservationDatesp = null;
        }
    });
    /* -----------------------------------------------------------------------*/
    $('#billTemplatesId').live('change', function (e) {
        var template = $(this).val();
        var billnameid = $('#billnameid').val();
        $.ajax({
            type: 'POST',
            url: 'sellbillAjaxController.php?do=getTemplateProducts',
            data: {template: template, billnameid: billnameid},
            async: false,
            success: function (data) {
                if (data != "") {
                    $('#manyParcodes').html(data);
                    //$('#myModalManyParcodes').modal('show');
                    $('#doAddManyParcodes').click();
                }
            }
        });
    });
    /* -----------------------------------------------------------------------*/


    /* -----------------------------------------------------------------------*/
    //for save bill in restaurant
    $('.drinkDetails').live('click', function (e) {
        e.preventDefault();
        e.stopPropagation();
        var itr = $(this).attr('data-itr');
        var productId = $('#product' + itr).val();
        var quantity = $('#pronum' + itr).val();

        saveDrinkDetails(productId, 'bill', itr, quantity);

    });
    function saveDrinkDetails(productId, tableId, itr, quantity) {
        $.ajax({
            type: 'POST',
            url: 'sellbillAjaxController.php?do=saveDrinkDetails',
            data: {productId: productId, tableId: tableId, itr: itr, quantity: quantity},
            async: false,
            success: function (data) {
                if (data != "") {
                    $('#drinkDetailsInfo').html(data);
                    $('#drinkDetailsModal').modal('show');
                }
            }
        });
    }
    $('.saveDrinkDetails').live('click', function (e) {
        e.preventDefault();
        if ($('#drinkDetailsInfo').valid()) {
            var notes = $('#notes').val();
            var quantity = Number($('#quantity').val());
            var printedQuantity = Number($('#printedQuantity').val());
            var thisItr = Number($('#thisItr').val());
            var total = 0;
            var totalStr = '';
            var totalAsNote = '';
            $('.drinkDetailsClass').each(function () {
                var val = Number($(this).val());

                var thisId = $(this).attr('id');
                total += val;
                switch (thisId) {
                    case 'sugarPlusPlus':
                        if (val != 0) {
                            totalStr += val + ' زيادة عالى ';
                        }
                        totalAsNote += val + ',';
                        break;
                    case 'sugarPlus':
                        if (val != 0) {
                            totalStr += val + ' زيادة ';
                        }
                        totalAsNote += val + ',';
                        break;
                    case 'mano':
                        if (val != 0) {
                            totalStr += val + ' مانو ';
                        }
                        totalAsNote += val + ',';
                        break;
                    case 'sugarExact':
                        if (val != 0) {
                            totalStr += val + ' مظبوط ';
                        }
                        totalAsNote += val + ',';
                        break;
                    case 'sugarMinus':
                        if (val != 0) {
                            totalStr += val + ' عالريحه ';
                        }
                        totalAsNote += val + ',';
                        break;
                    case 'sugarNo':
                        if (val != 0) {
                            totalStr += val + ' ساده ';
                        }
                        totalAsNote += val + ',';
                        break;
                }
            });
            totalStr = totalStr.slice(0, -1);
            totalAsNote = totalAsNote.slice(0, -1);
            if (total != quantity) {
                alert('عفوا لم تدخل تفاصيل كل الطلبات');
            } else {
                $('#notes' + thisItr).html(totalStr);
                $('#hiddenNotes' + thisItr).val(totalAsNote);
                $('#drinkDetailsModal').modal('hide');
            }

        }
    });
    /*-----------------------------------------------------------*/
    //plugin bootstrap minus and plus
    //https://bootsnipp.com/snippets/featured/buttons-minus-and-plus-in-input

    $('.btn-number').live('click', function (e) {
        e.preventDefault();

        fieldName = $(this).attr('data-field');
        type = $(this).attr('data-type');
        var input = $("input[name='" + fieldName + "']");
        var currentVal = parseInt(input.val());
        if (!isNaN(currentVal)) {
            if (type == 'minus') {

                if (currentVal > input.attr('min')) {
                    input.val(currentVal - 1).change();
                }
                if (parseInt(input.val()) == input.attr('min')) {
                    $(this).attr('disabled', true);
                }

            } else if (type == 'plus') {

                if (currentVal < input.attr('max')) {
                    input.val(currentVal + 1).change();
                }
                if (parseInt(input.val()) == input.attr('max')) {
                    $(this).attr('disabled', true);
                }

            }
        } else {
            input.val(0);
        }
    });
    $('.input-number').live('focusin', function (e) {
        $(this).data('oldValue', $(this).val());
    });
    $('.input-number').live('change', function (e) {

        minValue = parseInt($(this).attr('min'));
        maxValue = parseInt($(this).attr('max'));
        valueCurrent = parseInt($(this).val());

        name = $(this).attr('name');
        if (valueCurrent >= minValue) {
            $(".btn-number[data-type='minus'][data-field='" + name + "']").removeAttr('disabled')
        } else {
            alert('عفوا وصلت للحد الادنى');
            $(this).val($(this).data('oldValue'));
        }
        if (valueCurrent <= maxValue) {
            $(".btn-number[data-type='plus'][data-field='" + name + "']").removeAttr('disabled')
        } else {
            alert('عفوا وصلت للحد الاقصى');
            $(this).val($(this).data('oldValue'));
        }


    });

    /* -----------------------------------------------------------------------*/
    $('.addtaxes').live('click', function (e) {
        var mitr = Number($(this).attr('data-mitr'));
        var itr = Number($('#taxesitr_' + mitr).val()) + 1;
        $.ajax({
            type: 'POST',
            url: 'sellbillAjaxController.php?do=addtaxes',
            data: {itr: mitr, itr2: itr},
            async: false,
            success: function (data) {
                $('#taxes' + mitr).append(data);
                $('#taxesitr_' + mitr).val(itr);
                Taxes(mitr, itr);

            }
        });
    });


    /* -----------------------------------------------------------------------*/
    $('.removetaxes').live('click', function (e) {
        var mitr = Number($(this).attr('data-mitr'));
        var edit = Number($(this).attr('data-edit'));
        var id = Number($(this).attr('data-id'));
        if (edit == 1 && id) {
            var ordertype = 0;
            if (Number($('#offerId').val()) > 0) {
                ordertype = 1;
            }
            $.ajax({
                type: 'POST',
                url: 'sellbillAjaxController.php?do=removetaxes',
                data: {id: id, ordertype: ordertype},
                async: false,
                success: function (data) {
                    $('#taxes' + mitr).remove();
                }
            });
        } else {
            $('#taxes' + mitr).remove();
        }

    });

    $('.removeellbilldetailtax').live('click', function (e) {
        var mitr = $(this).attr('data-mitr');
        var itr = $(this).attr('data-itr');
        var edit = Number($(this).attr('data-edit'));
        var id = Number($(this).attr('data-id'));
        if (edit == 1 && id) {
            $.ajax({
                type: 'POST',
                url: 'sellbillAjaxController.php?do=removeellbilldetailtax',
                data: {id: id},
                async: false,
                success: function (data) {
                    $('#litaxes_' + mitr + '_' + itr).remove();
                }
            });
        } else {
            $('#litaxes_' + mitr + '_' + itr).remove();
        }

    });
    $('.Taxes').live('click', function (e) {
        var mitr = Number($(this).attr('data-mitr'));
        var itr = mitr;
        var product = Number($('#product' + mitr).val());
        if (product < 1) {
            $('#ebillclient' + mitr).modal('hide');
        } else {
            $('#ebillclient' + mitr).modal('show');
            var eTaxsubtype = $("#eTaxsubtype_" + mitr + '_1').val();
            if (!eTaxsubtype) {
                Taxes(mitr, 1);
            }

            var citr2 = 1;
            $('.oldtype' + itr).each(function () {
                var id = $(this).attr('id');
                var sid = $(this).attr('data-id');
                var stext = $(this).attr('data-text');
                var sid2 = $(this).attr('data-sid');
                var stext2 = $(this).attr('data-stext');
                Taxes(itr, citr2);
                citr2++;
                $('#eTaxType_' + id).select2('data', {id: sid, text: stext});
                $('#eTaxsubtype_' + id).select2('data', {id: sid2, text: stext2});
            });


            $rowsneeded = 3 - $('.rate_' + mitr).length;
            for ($i = 0; $i < $rowsneeded; $i++) {
                $('#addtaxes' + mitr).click();
            }

        }
    });
    $('.ncloseebill').live('change', function (e) {
        var mitr = $(this).attr('data-mitr');
        var itr = $(this).attr('data-itr');
        //closeebill(mitr, itr);//would be called inside totalprice
        totalprice();
        thegeneraldiscount();//to calc sellbillaftertotalbill value
    });

    $('.closeebill').live('click', function (e) {
        var mitr = $(this).attr('data-mitr');
        var itr = $(this).attr('data-itr');
        //closeebill(mitr, itr);//would be called inside totalprice
        totalprice();
        thegeneraldiscount();//to calc sellbillaftertotalbill value
    });

    function closeebill(mitr = 1, itr = 1) {


        var myarray = {};
        $('.amounts').each(function () {
            var mitr = $(this).attr('data-mitr');
            var itr = $(this).attr('data-itr');
            var proprice = $('#hidden_prototal' + mitr).val();
            var eTaxsubtype = $("#eTaxsubtype_" + mitr + '_' + itr).val();
            if (eTaxsubtype) {
                var eTaxType = $("#eTaxType_" + mitr + '_' + itr).val();
                var rate = $("#rate_" + mitr + '_' + itr).val();
                // alert(proprice + ' / ' + rate);
                if (rate) {
                    var amount = (proprice * rate) / 100;
                    $("#amount_" + mitr + '_' + itr).val(amount);
                } else {
                    var amount = Number($(this).val());
                }

                var intext = eTaxsubtype + ' - ' + eTaxType;
                if (intext in myarray) {
                    myarray[intext] = Number(myarray[intext]) + amount;
                } else {
                    myarray[intext] = amount;
                }
            }

        });
        $("#closeebill").html('');
        var etotal = 0;
        jQuery.each(myarray, function (index, item) {
            $("#closeebill").append('<div class="form-group mg-bt5">'
                    + '<label class="col-lg-3 control-label">' + index + '</label>'
                    + '<div class="col-lg-3">' + item + '</div>'
                    + '</div>');
            etotal += Number(item);
        });
        $("#etotal").val(etotal);

    }
    ;
    function Taxes(itr, itr2) {
        $("#eTaxsubtype_" + itr + '_' + itr2).select2({
            placeholder: "اختر",
            minimumInputLength: 0, // document.getElementById("searchvalue").value,
            multiple: false,
            quietMillis: 100,
            ajax: {
                type: 'POST',
                url: "eBillRequests.php?do=tax-subtypes",
                dataType: 'json',
                data: function (term, page) {
                    var typeid = $('#eTaxType_' + itr + '_' + itr2).val();
                    return {
                        term: term,
                        typeid: typeid, //search term
                    };
                },
                results: function (data) {
                    return {results: data};
                }
            },
            formatResult: function (data) {
                return data.text;
            },
            initSelection: function (element, callback) {
                var item = element.val().split(':');
                //  var data = {id: item[0], text: item[1]};
                var data = {id: item[0], text: item[1]};
                callback(data);
            },
            //dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller
        });



        $("#eTaxType_" + itr + '_' + itr2).select2({
            placeholder: "اختر",
            minimumInputLength: 0, // document.getElementById("searchvalue").value,
            multiple: false,
            quietMillis: 100,
            ajax: {
                url: "eBillRequests.php?do=tax-types",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        term: term, //search term
                    };
                },
                results: function (data) {
                    return {results: data};
                }
            },
            formatResult: function (data) {
                return data.text;
            },
            initSelection: function (element, callback) {
                var item = element.val().split(':');
                //  var data = {id: item[0], text: item[1]};
                var data = {id: item[0], text: item[1]};
                callback(data);
            },
            //dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller
        });
        //this is needed for ajax =>to obtain id from it  and use in ajax
        // $('#eTaxType').select2('data', {id: $('#oldeTaxType').val(), text: $('#oldeTaxType').val()});
    }
    ;


    $('.input-number').live('keydown', function (e) {
        // Allow: backspace, delete, tab, escape, enter and .
        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 190]) !== -1 ||
                // Allow: Ctrl+A
                        (e.keyCode == 65 && e.ctrlKey === true) ||
                        // Allow: home, end, left, right
                                (e.keyCode >= 35 && e.keyCode <= 39)) {
                    // let it happen, don't do anything
                    return;
                }
                // Ensure that it is a number and stop the keypress
                if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
                    e.preventDefault();
                }
            });
    /*-----------------------------------------------------------*/
</script>



<!--
<script type="text/javascript">
    /*var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "real");



    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "real");
    var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "real");
    var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "real");
    var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "real");
    var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "integer");
    var sprytextfield10 = new Spry.Widget.ValidationTextField("sprytextfield10", "integer");
    var sprytextfield11 = new Spry.Widget.ValidationTextField("sprytextfield11");*/

</script>

<script type="text/javascript">
</script>--><?php }} ?>