<?php /* Smarty version Smarty-3.1.11, created on 2024-05-13 16:40:33
         compiled from "../views/default/allReportsOnOne/headReport.html" */ ?>
<?php /*%%SmartyHeaderCode:683580166421851998e10-92545423%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '8d457f1d41e42af3cbed797db082db6b68c1402a' => 
    array (
      0 => '../views/default/allReportsOnOne/headReport.html',
      1 => 1693253990,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '683580166421851998e10-92545423',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'youtubes' => 0,
    'outputString' => 0,
    'Programsettingdata' => 0,
    'Usergroupdata' => 0,
    'storeData' => 0,
    'store' => 0,
    'suppliersData' => 0,
    'mysuppliersData' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_66421851a33197_57010373',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_66421851a33197_57010373')) {function content_66421851a33197_57010373($_smarty_tpl) {?><div class="panel panel-default panel-m">
    <div class="panel-heading" style="padding:5px 15px 15px">
        <h3 class="panel-title" style="display: inline-block;"> تقرير شامل للفواتير</h3>
        <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[31]->url;?>
" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
    </div>
    <div class="panel-body">
        <div id="outputString" class="alert alert-block alert-success fade in hidden-print" style="display:none">
            <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">&times;</button>
            <p id="outputStringValue"><?php echo $_smarty_tpl->tpl_vars['outputString']->value;?>
</p>
            <div class="clearfix"></div>
        </div>
        <input type="hidden" id="searchvalue" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->searchvalue;?>
">
        <input type="hidden" name="withNakdi" id="withNakdi" value="<?php echo $_smarty_tpl->tpl_vars['Usergroupdata']->value->showClientAndSupplierOne;?>
"/>
        <form class="form-inline hidden-print" action="allReportsOnOne.php?do=show" method="post">
            <div class="form-group">
                <div class="col-md-2">
                    <label class="sr-only">المخزن</label>
                </div>
                <select class="select2 wdt100"  name="storeId" id="storeId" >
                    <option value="-1">اختر مخزن</option>
                    <option value="0">كل المخازن</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>
            </div>
            <div class="form-group" style="width: 30%;">
                <label class="sr-only">العميل</label>
                <input type="hidden" name="clientid" id="clientid" class="select2Supp"/>
                <input type="hidden" name="oldsupplierid" id="oldsupplierid" value=""/>
                <input type="hidden" name="oldsuppliername" id="oldsuppliername" value=""/>
            </div>
            <div class="form-group">
                <label class="sr-only">المورد</label>
                <select class="select2 wdt100"  name="supplierId" id="supplierId" >
                    <option value="-1">اختر مورد</option>



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



                    <option value="<?php echo $_smarty_tpl->tpl_vars['mysuppliersData']->value->supplierid;?>
"><?php echo $_smarty_tpl->tpl_vars['mysuppliersData']->value->suppliername;?>
</option>


                    <?php } ?>



                </select>
            </div>
            <div class="form-group">
                <label class="sr-only">رقم تسلسل الفاتورة</label>
                <input type="text" class="form-control" placeholder="رقم تسلسل الفاتورة" name="sellbillid" id="sellbillid">
            </div>
            <div class="form-group" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->billid;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==1){?>  style="display:none" <?php }?>>
                <label class="sr-only">رقم الفاتورة</label>
                <input type="text" class="form-control" placeholder="رقم الفاتورة" name="sellbillserial" id="sellbillserial">
            </div>
            <div class="form-group">
                <label class="sr-only">من التاريخ</label>
                <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" >
            </div>
            <div class="form-group">
                <label class="sr-only">إلى التاريخ</label>
                <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
            </div>
            <div class="form-group">
                <label class="sr-only">Serial</label>
                <input type="text" class="form-control" name="proSellTrackingSerial" id="proSellTrackingSerial" value="">
            </div>

            <div class="form-group">
                <label class="sr-only">نوع الفاتورة</label>
                <div  class="input-group" style="display: block">
                    <label>  <input value="1" name="obgyBillType" id="obgyBillType" type="radio">
                        مباشر</label>
                    <label>
                        <input value="2" name="obgyBillType" id="obgyBillType" type="radio">
                        مستهلك</label>
                    <label>
                        <input value="3" name="obgyBillType" id="obgyBillType" type="radio">
                        استقبال</label>
                </div>
            </div>
            <br>
            <div class="form-group">
                <label class="sr-only">
                    <input type="checkbox" id="rep1" name="rep1" value="1"> تقرير المبيعات </label>
            </div>
            <div class="form-group">
                <label class="sr-only">
                    <input type="checkbox" id="rep2" name="rep2" value="1">تقرير مردود المبيعات</label>
            </div>
            <div class="form-group">
                <label class="sr-only">
                    <input type="checkbox" id="rep3" name="rep3" value="1">تقرير المبيعات و مردود المبيعات</label>
            </div>
            <div class="form-group">
                <label class="sr-only">
                    <input type="checkbox" id="rep4" name="rep4" value="1">تقرير المشتريات</label>
            </div>
            <div class="form-group">
                <label class="sr-only">
                    <input type="checkbox" id="rep5" name="rep5" value="1">تقرير مردودات المشتريات</label>
            </div>
            <div class="form-group">
                <label class="sr-only">
                    <input type="checkbox" id="rep6" name="rep6" value="1">تقرير المشتريات ومردود المشتريات</label>
            </div>
            <br>
            <button type="submit" class="btn btn-primary">بحث</button>
        </form>
    </div>
</div>


<script>
    $(function () {
        $(".select2Supp").select2({
            placeholder: "العميل",
            minimumInputLength: document.getElementById("searchvalue").value,
            inimumInputLength: 0,
            multiple: false,
            quietMillis: 100,
            //]width: '80%',
            ajax: {
                url: "clientControllerAjax.php?do=select2ClientsAjax",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        term: term, //search term
                        page_limit: 7, // page size
                        withAddOption: 0,
                        withNakdi: function () {
                            return (Number($('#withNakdi').val()) == 1) ? 0 : 1;
                        },
                        //jsonRowRet: 1,
                    };
                },
                results: function (data) {
                    return {results: data};
                }
            },
            formatResult: function (data) {
                if (Number(data.id) == -2) {
                    return  '<span class="newoption">' + data.text + '</span >';
                } else {
                    return  '<span>' + data.text + '</span >';
                }
            },
            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], productquantity: item[2], price: item[3]};
                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
        $('#clientid').select2('data', {id: $('#oldsupplierid').val(), text: $('#oldsuppliername').val()});
    });
</script>
<?php }} ?>