<?php /* Smarty version Smarty-3.1.11, created on 2023-12-31 22:31:15
         compiled from "../views/default/sellBillReportsview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:3067158326591cf938c6268-54068939%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '28e75c3948cffd5add75ba036a3976a47d0bc5c2' => 
    array (
      0 => '../views/default/sellBillReportsview/show.html',
      1 => 1693253994,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '3067158326591cf938c6268-54068939',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'message' => 0,
    'youtubes' => 0,
    'outputString' => 0,
    'clientData' => 0,
    'client' => 0,
    'Programsettingdata' => 0,
    'totaldiscount' => 0,
    'totaltax' => 0,
    'totalBills' => 0,
    'totalQTY' => 0,
    'sellbillData' => 0,
    'sellbill' => 0,
    'i' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_6591cf93a01dd4_39360362',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6591cf93a01dd4_39360362')) {function content_6591cf93a01dd4_39360362($_smarty_tpl) {?>
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">ادارة الفواتير</a></li>
            <li><a href="#">فواتير البيع</a></li>
            <li class="active">تقرير فواتير المبيعات</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">تقرير فواتير المبيعات<br />
                <?php if ($_smarty_tpl->tpl_vars['message']->value!=''){?>
                <?php echo $_smarty_tpl->tpl_vars['message']->value;?>

                <?php }?>
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[27]->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>
                <form class="form-inline hidden-print" action="sellBillReportsController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">العميل</label>
                        <select class="select2 wdt100"  name="clientid" id="clientid" >
                            <option value="-1">اختر عميل</option>




                            <?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>
                    </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 search_bill" placeholder="التعليق" name="sellbillcomment" id="sellbillcomment">
                        </div>
                    <br/>
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <hr/>
            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">إجمالي الخصومات:  <?php echo $_smarty_tpl->tpl_vars['totaldiscount']->value;?>
</h4>
                </div>
            </div>

            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">إجمالي ضرائب المبيعات:  <?php echo $_smarty_tpl->tpl_vars['totaltax']->value;?>
</h4>
                </div>
            </div>

            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">إجمالي المبيعات:  <?php echo $_smarty_tpl->tpl_vars['totalBills']->value;?>
</h4>
                </div>
            </div>

            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">عدد القطع المباعة:  <?php echo $_smarty_tpl->tpl_vars['totalQTY']->value;?>
</h4>
                </div>
            </div>
            <table class="table table-black dataTableClass">
                <thead>
                    <tr>
                        <th class="hidden-print">
                            <input type="checkbox" name="checkAll" id="checkAll"/>
                        </th>
                        <th>رقم تسلسل الفاتورة</th>
                        <th>اجمالى الفاتورة</th>

                        <th>الخصم</th>
                        <th>ضريبه المبيعات</th>

                        <th>تاريخ الفاتورة</th>

                        <th>العميل</th>
                        <th><?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 }?></th>
                        <th class="hidden-print">تفاصيل الفاتورة</th>
                        <th class="hidden-print">اكسل</th>
                    </tr>
                </thead>
                <tbody>

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

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

                    <tr> <?php }}?>
                        <td class="hidden-print">
                            <input type="checkbox" name="choosedItem[]" id="checked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="choosenItem" value="<?php echo $_smarty_tpl->tpl_vars['sellbill']->value->sellbillid;?>
" />
                        </td>
                        <td><?php echo $_smarty_tpl->tpl_vars['sellbill']->value->sellbillid;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['sellbill']->value->sellbillaftertotalbill;?>
</td>

                        <td><?php echo $_smarty_tpl->tpl_vars['sellbill']->value->sellbilldiscount;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['sellbill']->value->tax;?>
 </td>


                        <td><?php echo $_smarty_tpl->tpl_vars['sellbill']->value->sellbilldate;?>
</td>
                        <td> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['sellbill']->value->clientname;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==''){?>
                            نقدى
                            <?php }else{ ?>
                            <?php echo $_smarty_tpl->tpl_vars['sellbill']->value->clientname;?>

                            <?php }?> </td>
                        <td><?php echo $_smarty_tpl->tpl_vars['sellbill']->value->employeename;?>
</td>
                        <td class="hidden-print">
                            <?php if ($_smarty_tpl->tpl_vars['sellbill']->value->type=="sell"){?>
                            <a href="sellbillController.php?do=showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['sellbill']->value->sellbillid;?>
" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                        <?php }elseif($_smarty_tpl->tpl_vars['sellbill']->value->type=="sellAndReturn"){?>
                <a href="sellbillandruternController.php?do=showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['sellbill']->value->sellbillid;?>
" type="button" class="btn btn-default btn-lg editicon"></a>
                <?php }?>
                </td>
                <td class="hidden-print"> <?php if ($_smarty_tpl->tpl_vars['sellbill']->value->type=="sell"){?><a href="sellbillController.php?do=billToExcel&sellbillid=<?php echo $_smarty_tpl->tpl_vars['sellbill']->value->sellbillid;?>
" type="button" class="btn btn-default btn-lg excelicon"></a><?php }else{ ?>-<?php }?> </td>
                </tr>
                <?php }?>
                <?php } ?>

                </tbody>

            </table>
            <div class="clearfix"></div>
            <input name="" id="excuteOperationBtn" class="noprint btn btn-success" type="button" value="طباعة مجمعة"/>
            <hr />
            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">إجمالي الخصومات:  <?php echo $_smarty_tpl->tpl_vars['totaldiscount']->value;?>
</h4>
                </div>
            </div>

            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">إجمالي ضرائب المبيعات:  <?php echo $_smarty_tpl->tpl_vars['totaltax']->value;?>
</h4>
                </div>
            </div>

            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">إجمالي المبيعات:  <?php echo $_smarty_tpl->tpl_vars['totalBills']->value;?>
</h4>
                </div>
            </div>

            <div class="col-lg-offset-16 col-lg-3 ">
                <div class="well well-sm">
                    <h4 class="text-center">عدد القطع المباعة:  <?php echo $_smarty_tpl->tpl_vars['totalQTY']->value;?>
</h4>
                </div>
            </div>
            <div class="clearfix"></div>
            </form>
        </div>
    </div>
</div>

<script>
    //
    $('#excuteOperationBtn').live('click', function (e) {
        var ids = '';
        $(".choosenItem:checked").each(function () {
            ids += $(this).val() + ',';
        });
        if (ids != "") {
            window.open('sellbillprintController.php?do=showDetail2Bulk&id=' + ids);
        } else {
            alert('عفوا اختر عناصر اولا');
        }
    });
    $('#checkAll').click(function (event) {
        if (this.checked) {
            // Iterate each checkbox
            $('.choosenItem').each(function () {
                this.checked = true;
            });
        } else {
            // Iterate each checkbox
            $(".choosenItem").each(function () {
                this.checked = false;
            });
        }
    });
</script>
<?php }} ?>