<?php /* Smarty version Smarty-3.1.11, created on 2024-12-02 15:55:25
         compiled from "../views/default/dailyentryview/add.html" */ ?>
<?php /*%%SmartyHeaderCode:109916033674dbc4d1444a7-06217071%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '896afeb0e2a21528ad6ab73b90a638a985242838' => 
    array (
      0 => '../views/default/dailyentryview/add.html',
      1 => 1693253992,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '109916033674dbc4d1444a7-06217071',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'youtubes' => 0,
    'user_data' => 0,
    'allbranchdata' => 0,
    'myallbranchdata' => 0,
    'now' => 0,
    'allDailyEnteryCount' => 0,
    'allDailyEntery' => 0,
    'dailyEntery' => 0,
    'i' => 0,
    'debtorTotal' => 0,
    'creditorTotal' => 0,
    'accountsTree' => 0,
    'element' => 0,
    'costCenter' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_674dbc4d2680d2_65850270',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_674dbc4d2680d2_65850270')) {function content_674dbc4d2680d2_65850270($_smarty_tpl) {?><style>
    .solidgraytop{
        border-top-style:solid;
        border-top-color:#ddd;
    }
    .solidgrayleft{
        border-left:solid;
        border-left-width:3px;
        border-color: #ddd;
    }
    .solidgrayright{
        border-right-style:solid;
        border-right-color:#ddd;
    }
    .solidgraybottom{
        border-top-style:solid;
        border-top-color:#ddd;
    }
    .hidetop{
        border-top:hidden !important;
    }
    .fromaccountstyle{
        font-weight:bold;
        font-size:17px;
        color:blue;
    }
    .toaccountstyle
    {
        font-weight:bold;
        font-size:17px;
        color:purple;
    }
    .mytotal{
        background-color:#ddd;
        font-weight:bold;
    }
    .nodata{
        background-color: #72B4EC;
        color: white;
        border-radius: 13px;
        margin: 14px;
        font-size: 24px;
        text-align: center;
        padding: 5px;
    }

</style>
<div class="row">
    <div class="container">
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title"><strong> اضافة فى قيد يومية</strong></h3>
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[219]->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">
                <form class="nameToBeChecked form-horizontal" action="" method="post" id="dailyEntry_Form">
                    <input type="hidden" id="selectedIds" name="selectedIds" value=""/>
                    <input type="hidden" id="searchvalue" name="searchvalue" value="1"/>
                    <?php if ($_smarty_tpl->tpl_vars['user_data']->value->branchId==0){?>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">الفرع</label>
                        <div class="col-lg-4">
                            <select  class="select2 " name="branchid_entry" id="branchid_entry" >
                                <option value="-1">اختر الفرع</option>

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

                                <option value="<?php echo $_smarty_tpl->tpl_vars['myallbranchdata']->value->branchId;?>
" <?php if ($_smarty_tpl->tpl_vars['myallbranchdata']->value->branchId==0){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['myallbranchdata']->value->branchName;?>
</option>

                                <?php } ?>


                            </select>
                        </div>
                    </div>
                    <?php }else{ ?>
                    <input type="hidden" name="branchid_entry" id="branchid_entry" value="<?php echo $_smarty_tpl->tpl_vars['user_data']->value->branchId;?>
"/>
                    <?php }?>
                    <div class="col-lg-12" style="padding: 0">
                        <div class="form-group">
                            <label class="col-lg-2 control-label">تاريخ القيد</label>
                            <div class="col-lg-4">
                                <div class="input-group date form_datetime col-md-5" data-date="" data-date-format="yyyy-mm-dd  h:i:s" data-link-field="dtp_input1">
                                    <input class="form-control" size="16" type="text" value="<?php echo $_smarty_tpl->tpl_vars['now']->value;?>
" readonly="" id="dDateTime" name="dDateTime">
                                    <span class="input-group-addon "><span class=" glyphicon glyphicon-remove col-lg-4"></span></span>
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-th col-lg-4"></span></span>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-lg-2 control-label">بيان القيد </label>
                            <div class="col-lg-4">
                                <textarea class="form-control" rows="3" id="entryComment" name="entryComment"></textarea>
                            </div>
                        </div>
                    </div>
                    <div style="clear:both"></div>
                    <br/>
                    <div style="clear:both"></div>
                    <button type="button" class="btn btn-primary" style="float: left;" id="DE_add">اضافة</button>
                    <input type="hidden" id="itr" name="itr" value="0" />
                    <table class="table table-black" >

                        <thead>
                            <tr>
                                <th>#</th>
                                <th>اسم الحساب</th>
                                <th>مدين</th>
                                <th>دائن</th>
                                <th>ملاحظة</th>
                                <th>مركز التكلفة</th>
                                <th>حذف</th>
                            </tr>
                        </thead>
                        <tbody id="DE_Table">

                        </tbody>
                        <tr class="mytotal bg-dark">
                            <td>الاجمالى</td>
                            <th></th>
                            <th id="totalValueFrom">0</th>
                            <th id="totalValueTo">0</th>
                            <th></th>
                            <th></th>
                            <th></th>
                        </tr>
                    </table>
                    <br/>
                    <!-- totals ------------------------------------------------->
                    <input type="hidden" id="totalValueFrom_hidden" name="totalValueFrom_hidden" value="0"/>
                    <input type="hidden" id="totalValueTo_hidden" name="totalValueTo_hidden" value="0"/>
                    <!-- totals ------------------------------------------------->


                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button name="btnAdd" type="button" id="btnAdd_dailyEntry" class="btn btn-primary pull-left">حفظ</button>
                        </div>
                    </div>
                    <div style="clear: both"></div></br>
                    <div class="form-group col-lg-12">
                        <div class="alert alert-success" style="font-size: 22px;text-align: center;display: none">
                            <button class="close" data-dismiss="alert"></button>
                            تمت العملية بنجاح
                            <!--Your form validation is successful!-->
                        </div>
                    </div><div style="clear: both"></div>
                </form>
            </div>
        </div>


        <!--show-------------------------------------------------------------------------------------------->
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title"><strong> قيد يومية</strong></h3>

            </div>
            <div class="panel-body">
                <form class="form-inline hidden-print" action="" method="post" id="DEForm">
                    <div class="form-group">
                        <label class="sr-only">رقم القيد</label>
                        <input type="text" class="form-control" placeholder="رقم القيد" name="dailyentryid" id="dailyentryid">
                    </div>


                    <div class="form-group">
                        <label for="usergroupid" class="col-lg-4 control-label">الفرع</label>
                        <div >



                            <select  class="select2 " name="branchid" id="branchid" >
                                <option value="-1">اختر الفرع</option>

                                <?php  $_smarty_tpl->tpl_vars['myallbranchdata'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['myallbranchdata']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allbranchdata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['myallbranchdata']->key => $_smarty_tpl->tpl_vars['myallbranchdata']->value){
$_smarty_tpl->tpl_vars['myallbranchdata']->_loop = true;
?>
                                <option value="0">كل الفروع</option>

                                <option value="<?php echo $_smarty_tpl->tpl_vars['myallbranchdata']->value->branchId;?>
"><?php echo $_smarty_tpl->tpl_vars['myallbranchdata']->value->branchName;?>
</option>

                                <?php } ?>


                            </select>

                        </div>
                    </div>
                    <!--div class="form-group" style="width:270px  ;">
                        <label class="sr-only">ترتيب القيد</label>
                        <input type="hidden"  class="getlayingOrder wdt600" name="layingOrder" id="layingOrder" data-placeholder="اختر"  />
                    </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="datefrom" >
                    </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="dateto" >
                    </div>





                    <button type="button" class="btn btn-primary DEsubmit" id="DESerach">بحث</button>
                    <button type="button" class="btn btn-success DEsubmit" id="DESerachPrint">بحث و طياعة</button>
                </form>
                <div id="dailyEntryTable">
                    <?php if ($_smarty_tpl->tpl_vars['allDailyEnteryCount']->value>0){?>
                    <br />
                    <hr/>
                    <br/>
                    <table class="table table-black">
                        <thead>
                            <tr class="mytotal">
                                <th class="solidgrayright">#</th>
                                <th class="solidgrayright">رقم القيد</th>
                                <th class="solidgrayright">الفرع</th>
                                <th>مدين</th>
                                <th>دائن</th>
                                <th>الحساب</th>
                                <th>التاريخ</th>
                                <th>البيان</th>
                                <th class="solidgrayleft">بيان القيد</th>
                                <th class="solidgrayleft">عكس القيد</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                            <?php $_smarty_tpl->tpl_vars['debtorTotal'] = new Smarty_variable(0, null, 0);?>
                            <?php $_smarty_tpl->tpl_vars['creditorTotal'] = new Smarty_variable(0, null, 0);?>
                            <?php  $_smarty_tpl->tpl_vars['dailyEntery'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['dailyEntery']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDailyEntery']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['dailyEntery']->key => $_smarty_tpl->tpl_vars['dailyEntery']->value){
$_smarty_tpl->tpl_vars['dailyEntery']->_loop = true;
?>
                            <?php if ($_smarty_tpl->tpl_vars['dailyEntery']->value->id!=''){?>

                            <!--عكس القيد-->
                            <?php if ($_smarty_tpl->tpl_vars['dailyEntery']->value->reverseofid!=0&&$_smarty_tpl->tpl_vars['dailyEntery']->value->reverseofid!=-10&&$_smarty_tpl->tpl_vars['dailyEntery']->value->reverseofid!=-9){?>
                            <tr class="solidgraytop bg-open-report" >
                                <?php }else{ ?>
                            <tr class="solidgraytop">
                                <?php }?>

                                <td class="solidgrayleft solidgrayright"><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</td>
                                <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable($_smarty_tpl->tpl_vars['i']->value+1, null, 0);?>
                                <td class="solidgrayleft solidgrayright"><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->id;?>
</td>
                                <?php }else{ ?>
                                <!--عكس القيد-->
                                <?php if ($_smarty_tpl->tpl_vars['dailyEntery']->value->reverseofid>0){?>
                            <tr class="bg-open-report">
                                <?php }else{ ?>
                            <tr>
                                <?php }?>



                                <td class="hidetop solidgrayleft solidgrayright"></td>
                                <td class="hidetop solidgrayleft solidgrayright"></td>
                                <?php }?>



                                <td  ><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->branchName;?>
</td>
                                <?php if ($_smarty_tpl->tpl_vars['dailyEntery']->value->type==0){?>
                                <td><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->value;?>
</td>
                                <td></td>
                                <td> <span class="fromaccountstyle">من حــ/ </span> <?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->accountstreeName;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->dDateTime;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->dComment;?>
</td>
                                <?php $_smarty_tpl->tpl_vars['debtorTotal'] = new Smarty_variable($_smarty_tpl->tpl_vars['debtorTotal']->value+$_smarty_tpl->tpl_vars['dailyEntery']->value->value, null, 0);?>
                                <?php }else{ ?>
                                <td></td>
                                <td><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->value;?>
</td>
                                <td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="toaccountstyle">الى حــ/ </span><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->accountstreeName;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->dDateTime;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->dComment;?>
</td>
                                <?php $_smarty_tpl->tpl_vars['creditorTotal'] = new Smarty_variable($_smarty_tpl->tpl_vars['creditorTotal']->value+$_smarty_tpl->tpl_vars['dailyEntery']->value->value, null, 0);?>
                                <?php }?>




                                <?php if ($_smarty_tpl->tpl_vars['dailyEntery']->value->id!=''){?>
                                <td class="solidgrayleft solidgrayright"><?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->entryComment;?>


                                    <?php if ($_smarty_tpl->tpl_vars['dailyEntery']->value->operationDetailLink!=''){?>
                                    <br/> <a href="<?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->operationDetailLink;?>
" target="_blank" type="button" class="hidden-print" style="color: blue;"><u>تفاصيل</u></a>
                                    <?php }?>
                                </td>
                                <?php if ($_smarty_tpl->tpl_vars['dailyEntery']->value->reverseofid!=0||$_smarty_tpl->tpl_vars['dailyEntery']->value->reverseofid==-10||$_smarty_tpl->tpl_vars['dailyEntery']->value->reverseofid==-9){?>
                                <td class="solidgrayleft solidgrayright"><a class="btn btn-default btn-lg printicon" href="dailyentry.php?do=print&id=<?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->id;?>
" target="_blank"></a></td>
                                <?php }else{ ?>
                                <td class="solidgrayleft solidgrayright">
                                    <a class="btn btn-default btn-lg undoicon" href="dailyentry.php?do=reverse&id=<?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->id;?>
"></a>
                                    <a class="btn btn-default btn-lg printicon" href="dailyentry.php?do=print&id=<?php echo $_smarty_tpl->tpl_vars['dailyEntery']->value->id;?>
" target="_blank"></a>
                                </td>
                                <?php }?>
                                <?php }else{ ?>
                                <td class="hidetop solidgrayleft solidgrayright"></td>
                                <td class="hidetop solidgrayleft solidgrayright"></td>
                                <?php }?>
                            </tr>
                            <?php } ?>
                            <tr class="mytotal">
                                <td class="solidgrayright"></td>
                                <td class="solidgrayright"></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td colspan="5" class="solidgrayleft" style="text-align:center;"></td>

                            </tr>
                            <!--tr class="mytotal">
                                <td class="solidgrayright"></td>
                                <td class="solidgrayright"></td>
                                <td><?php echo $_smarty_tpl->tpl_vars['debtorTotal']->value;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['creditorTotal']->value;?>
</td>
                                <td colspan="3" class="solidgrayleft" style="text-align:center;">الاجــــــــــمــــــــــالــــــى</td>

                            </tr-->

                        </tbody>
                    </table>
                    <?php }else{ ?>
                    <div class="nodata">عفوا لا توجد نتائج</div>
                    <?php }?>
                </div>
                </br>
            </div>
        </div>
    </div>
</div>








<div id="accountsTree" style="display:none">
    <option value=""></option>
    <?php  $_smarty_tpl->tpl_vars['element'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['element']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['accountsTree']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['element']->key => $_smarty_tpl->tpl_vars['element']->value){
$_smarty_tpl->tpl_vars['element']->_loop = true;
?>
    <option value="<?php echo $_smarty_tpl->tpl_vars['element']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['element']->value->id;?>
-<?php echo $_smarty_tpl->tpl_vars['element']->value->name;?>
</option>
    <?php } ?>
</div>
<div id="costCenterDiv" style="display:none">
    <option value="0" selected="selected"> لا يوجد</option>
    <?php  $_smarty_tpl->tpl_vars['element'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['element']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['costCenter']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['element']->key => $_smarty_tpl->tpl_vars['element']->value){
$_smarty_tpl->tpl_vars['element']->_loop = true;
?>
    <option value="<?php echo $_smarty_tpl->tpl_vars['element']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['element']->value->name;?>
</option>
    <?php } ?>
</div>
<?php }} ?>