<?php /* Smarty version Smarty-3.1.11, created on 2023-10-21 21:11:02
         compiled from "../views/default/buyBillreportview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:9744563365341436230ad3-41292795%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '6782e1b94ac2e1064549db66b8ff415aed250e32' => 
    array (
      0 => '../views/default/buyBillreportview/show.html',
      1 => 1693253992,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '9744563365341436230ad3-41292795',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'message' => 0,
    'youtubes' => 0,
    'outputString' => 0,
    'suppliersData' => 0,
    'mysuppliersData' => 0,
    'totaldiscount' => 0,
    'totaltax' => 0,
    'totalBills' => 0,
    'totalqty' => 0,
    'Programsettingdata' => 0,
    'buyBillData' => 0,
    'mybuyBillData' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_653414362e5038_40241248',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_653414362e5038_40241248')) {function content_653414362e5038_40241248($_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[25]->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="buyBillreportController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">المورد</label>
                        <select class="select2 wdt100"  name="supplierId" id="supplierId" onchange="this.form.submit();">
                            <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="serial" id="serial">
                                        </div>-->
                    <div class="form-group">
                        <label class="sr-only">رقم تسلسل الفاتورة</label>
                        <input type="text" class="form-control" placeholder="رقم تسلسل الفاتورة"  name="buybillid" id="buybillid">
                    </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">
                <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['mybuyBillData'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['mybuyBillData']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['buyBillData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['mybuyBillData']->key => $_smarty_tpl->tpl_vars['mybuyBillData']->value){
$_smarty_tpl->tpl_vars['mybuyBillData']->_loop = true;
?>

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

                    <tr> <?php }}?>
                        <td><?php echo $_smarty_tpl->tpl_vars['mybuyBillData']->value->buybillid;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['mybuyBillData']->value->buybillaftertotalbill;?>
</td>

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

                        <td><?php echo $_smarty_tpl->tpl_vars['mybuyBillData']->value->buybilldate;?>
</td>
                        <td> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['mybuyBillData']->value->suppliername;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==''){?>
                            نقدى
                            <?php }else{ ?>
                            <?php echo $_smarty_tpl->tpl_vars['mybuyBillData']->value->suppliername;?>

                            <?php }?> </td>
                        <td><?php echo $_smarty_tpl->tpl_vars['mybuyBillData']->value->username;?>
</td>
                        <td class="hidden-print">
                            <?php if ($_smarty_tpl->tpl_vars['mybuyBillData']->value->controlname=="buybill"){?>
                            <a href="buyBillController.php?do=details&id=<?php echo $_smarty_tpl->tpl_vars['mybuyBillData']->value->buybillid;?>
" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                        <?php }else{ ?>
                <a href="buyAndReturnBillController.php?do=details&id=<?php echo $_smarty_tpl->tpl_vars['mybuyBillData']->value->buybillid;?>
" 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-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>
<?php }} ?>