<?php /* Smarty version Smarty-3.1.11, created on 2026-03-24 12:36:47
         compiled from "..\views\default\returnSellBillReportsview\show.html" */ ?>
<?php /*%%SmartyHeaderCode:1540469c2693fbadb29-18543917%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'bd7a2f105ed5bf73072ea250293dc394e195ed17' => 
    array (
      0 => '..\\views\\default\\returnSellBillReportsview\\show.html',
      1 => 1752437506,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1540469c2693fbadb29-18543917',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'message' => 0,
    'youtubes' => 0,
    'outputString' => 0,
    'clientData' => 0,
    'client' => 0,
    'Programsettingdata' => 0,
    'totaldiscount' => 0,
    'totaltax' => 0,
    'totalBills' => 0,
    'totalQTY' => 0,
    'returnsellbillData' => 0,
    'returnsellbill' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_69c2694004c168_78460429',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_69c2694004c168_78460429')) {function content_69c2694004c168_78460429($_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[28]->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="ReturnSellBillReportsController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">العميل</label>
                        <select class="select2 wdt100"  name="clientid" id="clientid" onchange="this.form.submit();">
                            <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>
                    <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>رقم تسلسل الفاتورة</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>
                    </tr>
                </thead>
                <tbody>

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

                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['returnsellbill']->value->conditions;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2!=1){?>
                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['returnsellbill']->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['returnsellbill']->value->conditions;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==0){?>

                    <tr> <?php }}?>
                        <td><?php echo $_smarty_tpl->tpl_vars['returnsellbill']->value->returnsellbillid;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['returnsellbill']->value->returnsellbillaftertotalbill;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['returnsellbill']->value->sellbilldiscount;?>
<?php echo $_smarty_tpl->tpl_vars['returnsellbill']->value->returnsellbilldiscount;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['returnsellbill']->value->tax;?>
 </td>

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

                            <?php }?> </td>
                        <td><?php echo $_smarty_tpl->tpl_vars['returnsellbill']->value->employeename;?>
</td>
                        <td class="hidden-print">
                            <?php if ($_smarty_tpl->tpl_vars['returnsellbill']->value->type=="returnSell"){?>
                            <a href="returnsellbillController.php?do=showDetail&returnsellbillid=<?php echo $_smarty_tpl->tpl_vars['returnsellbill']->value->returnsellbillid;?>
" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                        <?php }elseif($_smarty_tpl->tpl_vars['returnsellbill']->value->type=="sellAndReturn"){?>
                <a href="sellbillandruternController.php?do=showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['returnsellbill']->value->returnsellbillid;?>
" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                <?php }?>

                </tr>
                <?php }?>
                <?php } ?>

                </tbody>

            </table>
            <div class="clearfix"></div>
            <hr />
            <div class="col-lg-offset-8 col-lg-4 ">
                <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-8 col-lg-4 ">
                <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>
<?php }} ?>