<?php /* Smarty version Smarty-3.1.11, created on 2025-02-11 21:01:57
         compiled from "../views/default/supplierReportsview/supplierShow.html" */ ?>
<?php /*%%SmartyHeaderCode:74902804167ab9ea55075a0-47459743%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '77d2310d019f47b95483f951243866c1a8e7230d' => 
    array (
      0 => '../views/default/supplierReportsview/supplierShow.html',
      1 => 1698610734,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '74902804167ab9ea55075a0-47459743',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'message' => 0,
    'supplierData' => 0,
    'supplier' => 0,
    'programsettingsdata' => 0,
    'path' => 0,
    'burex' => 0,
    'shownData' => 0,
    'data' => 0,
    'j' => 0,
    'k' => 0,
    'supplierdebtchangeamountABS' => 0,
    'currency' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_67ab9ea56da113_67195022',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_67ab9ea56da113_67195022')) {function content_67ab9ea56da113_67195022($_smarty_tpl) {?><?php if (!is_callable('smarty_function_math')) include '/home/gt4it/public_html/muritrade/public/libs/plugins/function.math.php';
?><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">تقرير لمورد
                <?php if ($_smarty_tpl->tpl_vars['message']->value!=''){?>
                <?php echo $_smarty_tpl->tpl_vars['message']->value;?>

                <?php }?></div>
            <div class="panel-body">
                <form class="form-inline  hidden-print" action="supplierReportsController.php?do=oneSupplier"
                    method="post">
                    <div class="form-group wdt300">
                        <label class="sr-only"> اسم المورد</label>
                        <select data-placeholder="اختر مورد" class="select2 wdt300" name="supplierid" id="supplierid">
                            <option value="-1">اختر مورد</option>

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

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

                            <?php } ?>

                        </select>
                    </div>

                    <div class="form-group">
                        <label class="sr-only"> الترتيب بـ</label>
                        <select class="select2 wdt100" name="order" id="order">
                            <option value="0">id</option>
                            <option value="1">التاريخ</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <label class="sr-only">رصيد صافي</label>
                        <input name="bure" type="checkbox" id="bure" value="1" />
                        <label for="bure"></label>
                    </div>
                    <br />
                    <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" id="datepicker_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" id="datepicker_to">
                    </div>

                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <hr />
            <div class=" container  visible-print" style="width: 100% !important;">
                <div id="div1">
                    <br>
                    <?php echo $_smarty_tpl->tpl_vars['programsettingsdata']->value->companyname;?>

                </div>
                <div id="div2">
                    <img src="<?php echo $_smarty_tpl->tpl_vars['path']->value;?>
/images/upload/<?php echo $_smarty_tpl->tpl_vars['programsettingsdata']->value->logo;?>
" width="80px" height="80px">
                </div>

                <div id="div3">
                    <br>
                    <?php echo $_smarty_tpl->tpl_vars['programsettingsdata']->value->phone;?>

                </div>
            </div>
            <div id="resultDiv">
                <table class="table billtable table-bordered table-black">
                    <thead>
                        <tr>
                            <th><strong>م</strong></th>
                            <th><strong>التاريخ</strong></th>
                            <th><strong>الاسم</strong></th>
                            <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?> <th><strong>الدين قبل </strong></th><?php }?>
                                <th><strong>اجمالي العملية</strong></th>
                                <!--th><strong>المدفوع</strong></th-->
                                <!--<th> <table   class="table" border="1" width="100%"  style="text-align:center" >
                                <tr ><td colspan="2" > القيمة المتغيرة</td></tr>
                                   <tr><td>اضافه</td><td>خصم</td></tr>

                                </table>
                                </th>-->
                                <th>القيمة المتغيرة
                                    <table class="table table-black billtable table-bordered">
                                        <tr>
                                            <td style="color:#000"> اضافة</td><!-- وارد-->
                                            <td style="color:#000"> خصم</td><!-- صادر-->
                                        </tr>
                                    </table>
                                </th>
                                <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?> <th><strong>الدين بعد</strong></th><?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['programsettingsdata']->value->showCurrency==1){?>
                                    <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?><th><strong>الدين قبل بعملته </strong></th><?php }?>
                                        <th>القيمة المتغيرة بعملته
                                            <table class="table table-black billtable table-bordered">
                                                <tr>
                                                    <td style="color:#000"> اضافة</td><!-- وارد-->
                                                    <td style="color:#000"> خصم</td><!-- صادر-->
                                                </tr>
                                            </table>
                                        </th>
                                        <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?><th><strong>الدين بعد بعملته </strong></th><?php }?>
                                            <?php }?>
                                            <th><strong>العملية </strong></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $_smarty_tpl->tpl_vars['j'] = new Smarty_variable(0, null, 0);?>
                        <?php $_smarty_tpl->tpl_vars['k'] = new Smarty_variable(0, null, 0);?>
                        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['shownData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
 $_smarty_tpl->tpl_vars['data']->index=-1;
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
 $_smarty_tpl->tpl_vars['data']->index++;
?>
                        <?php if ($_smarty_tpl->tpl_vars['data']->value->supplierdebtchangeid>0){?>

                        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangeamount;?>
<?php $_tmp1=ob_get_clean();?><?php echo smarty_function_math(array('equation'=>"abs(x)",'x'=>$_tmp1,'assign'=>"supplierdebtchangeamountABS"),$_smarty_tpl);?>


                        <?php if ($_smarty_tpl->tpl_vars['data']->value->supplierdebtchangetype==1){?>
                        
                        <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'j', null); ob_start(); ?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangeamount;?>
<?php $_tmp2=ob_get_clean();?><?php echo $_smarty_tpl->tpl_vars['j']->value+$_tmp2;?>
<?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 }else{ ?>
                        <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'k', null); ob_start(); ?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['supplierdebtchangeamountABS']->value;?>
<?php $_tmp3=ob_get_clean();?><?php echo $_smarty_tpl->tpl_vars['k']->value+$_tmp3;?>
<?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 }?>

                        <tr <?php if ($_smarty_tpl->tpl_vars['data']->value->supplierdebtchangetype==0){?> class="danger" <?php }else{ ?> <?php }?>>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->index+1;?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangedate;?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value->suppliername;?>
</td>
                            <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?> <td><?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangebefore;?>
</td><?php }?>
                                <td><?php echo $_smarty_tpl->tpl_vars['data']->value->totalbillvalue;?>
</td>
                                <!--td ><?php echo $_smarty_tpl->tpl_vars['data']->value->buybillpaid;?>
</td-->
                                <td>
                                    <?php if ($_smarty_tpl->tpl_vars['data']->value->tablename=="buyBillController.php"&&$_smarty_tpl->tpl_vars['data']->value->buybillpaid!=0){?>
                                    <div style="float:left; margin: 10px 10px 10px 10px;">
                                        <?php echo $_smarty_tpl->tpl_vars['data']->value->buybillpaid;?>

                                    </div>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['data']->value->tablename=="returnBuyBillController.php"&&$_smarty_tpl->tpl_vars['data']->value->buybillpaid!=0){?>
                                    <div style="float:right; margin: 10px 10px 10px 10px;">
                                        <?php echo $_smarty_tpl->tpl_vars['data']->value->buybillpaid;?>

                                    </div>
                                    <?php }?>
                                    <div <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangetype;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==1){?> style="float:left; margin: 10px 10px
                                        10px 10px;" <?php }else{ ?> style="float:right; margin: 10px 10px 10px 10px;" <?php }?> >
                                        <?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangeamount;?>

                                    </div>
                                </td>
                                <!-- <td >
                              <table border="1" width="100%"  style="text-align:center" >

                                      <tr><td width="50%">   <?php if ($_smarty_tpl->tpl_vars['data']->value->supplierdebtchangetype==0){?><?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangeamount;?>
<?php }?></td><td width="50%"><?php if ($_smarty_tpl->tpl_vars['data']->value->supplierdebtchangetype==1){?> <?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangeamount;?>
<?php }?></td></tr>

                                   </table>

                             </td>-->
                                <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?> <td><?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangeafter;?>
</td><?php }?>

                                    <?php if ($_smarty_tpl->tpl_vars['programsettingsdata']->value->showCurrency==1){?>
                                    <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?><td><?php echo $_smarty_tpl->tpl_vars['data']->value->debtchangbeforeInSupplierCurrency;?>
</td><?php }?>
                                        <td>
                                            <div <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->supplierdebtchangetype;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==1){?> style="float:left; margin:
                                                10px 10px 10px 10px;" <?php }else{ ?> style="float:right; margin: 10px 10px 10px
                                                10px;" <?php }?> >
                                                <?php echo $_smarty_tpl->tpl_vars['data']->value->debtchangamountInSupplierCurrency;?>

                                            </div>
                                        </td>
                                        <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?><td><?php echo $_smarty_tpl->tpl_vars['data']->value->debtchangafterInSupplierCurrency;?>
</td><?php }?>
                                            <?php }?>


                                            <td>
                                                <a class=" hidden-print" <?php if ($_smarty_tpl->tpl_vars['data']->value->link==''){?> href="#" <?php }else{ ?>
                                                    href="<?php echo $_smarty_tpl->tpl_vars['data']->value->link;?>
" <?php }?>><?php echo $_smarty_tpl->tpl_vars['data']->value->processname;?>
<?php if ($_smarty_tpl->tpl_vars['data']->value->processname=="دفع
                                                    شيك"){?>(<?php echo $_smarty_tpl->tpl_vars['data']->value->bankname;?>
)/(<?php echo $_smarty_tpl->tpl_vars['data']->value->accountname;?>
)<?php }?></a>
                                                <div class="visible-print"><?php echo $_smarty_tpl->tpl_vars['data']->value->processname;?>
</div>
                                            </td>
                        </tr>

                        <?php }?>
                        <?php } ?>
                        <!--                        <tr>
                                                    <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <?php }else{ ?>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <?php }?>
                                                    <td> <table border="1" width="100%"  style="text-align:center" >
                                                            <tr><td width="50%">  <?php echo $_smarty_tpl->tpl_vars['k']->value;?>
</td><td width="50%"><?php echo $_smarty_tpl->tpl_vars['j']->value;?>
</td></tr>

                                                        </table>
                                                    </td>

                                                    <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?>
                                                    <td></td>
                                                    <td></td>
                                                    <?php }else{ ?>
                                                    <td></td>
                                                    <?php }?>
                                                </tr>-->
                    </tbody>

                </table>
                <div class="col-lg-offset-8 col-lg-4">
                    <!--div class="well well-sm">
                        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['j']->value;?>
<?php $_tmp6=ob_get_clean();?><?php if ($_tmp6==0){?>
                        <h4 class="text-center"> اجمالى المبلغ  <?php echo $_smarty_tpl->tpl_vars['k']->value;?>
  <?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</h4>
                        <?php }else{ ?>
                        <h4 class="text-center"> اجمالى المبلغ  <?php echo $_smarty_tpl->tpl_vars['j']->value;?>
  <?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</h4>
                        <?php }?>
                    </div-->
                    <div class="well well-sm">
                        <h4 class="text-center"> اجمالى المبلغ <?php echo $_smarty_tpl->tpl_vars['k']->value-$_smarty_tpl->tpl_vars['j']->value;?>
 <?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</h4>
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>
            <hr />
            <div class=" hidden-print">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-4">
                            <button type="button" onclick="print_Custom('mycustomheader');"
                                class="btn btn-success pull-right">طباعة</button>
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
        </div>

    </div>
</div>

<!--<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

<script>
                                $(function () {
                                    $("tbody").sortable();
                                })

</script>-->
<?php }} ?>