<?php /* Smarty version Smarty-3.1.11, created on 2025-01-27 15:15:01
         compiled from "../views/default/costcenterview/report.html" */ ?>
<?php /*%%SmartyHeaderCode:1582467472679786d5d5c3e5-02227305%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '3d635cd42817e423d3062c7dd0a4512bd68f215f' => 
    array (
      0 => '../views/default/costcenterview/report.html',
      1 => 1672089198,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1582467472679786d5d5c3e5-02227305',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'outputString' => 0,
    'allCostCenter' => 0,
    'costcenter' => 0,
    'allDetails' => 0,
    'details' => 0,
    'detail' => 0,
    'hosturl' => 0,
    'Revenues' => 0,
    'Expenses' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_679786d5f2dce4_67744745',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_679786d5f2dce4_67744745')) {function content_679786d5f2dce4_67744745($_smarty_tpl) {?>﻿<style type="text/css">
    th{
        text-align: center;
    }
    td{
        text-align: center;
        
    }
</style>
<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">تقرير مراكز التكلفه</div>
            <div class="panel-body">

                <!---------- start outputString alert ----------->
                <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>
                <!---------  end outputString alert ------------>

                <form method="post" class="form-inline" action="costcenterReportController.php?do=search" enctype="multipart/form-data">
                    <div class="form-group">

                        <label class="sr-only">مركز التكلفة</label>
                        <select class="select2 wdt300"   name="costCenterId"  data-placeholder="اختر مركز التكلفة " required>
                            <!-- <option value="-1">اختر مركز التكلفة</option> -->

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


                            <option value="<?php echo $_smarty_tpl->tpl_vars['costcenter']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['costcenter']->value->name;?>
</option>


                            <?php } ?>


                        </select>

                    </div>
                    <div id="dateOnlyDiv">
                        <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="start_date">
                        </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="end_date">
                        </div>
                        <div class="input-group">
                            <label> <input name="detail" type="checkbox" value="1">
                                مفصل</label>
                            
                        </div>
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
                <?php if (!empty($_smarty_tpl->tpl_vars['allDetails']->value)&&$_smarty_tpl->tpl_vars['details']->value!=1){?>
                <table class="table table-black">
                    <thead>
                        <tr>
                            <th>العملية</th>
                            <th>نوع العملية</th>
                            <th>القيمة</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php  $_smarty_tpl->tpl_vars['detail'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['detail']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDetails']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['detail']->key => $_smarty_tpl->tpl_vars['detail']->value){
$_smarty_tpl->tpl_vars['detail']->_loop = true;
?>
                        <tr>
                            <td>
                                <?php if ($_smarty_tpl->tpl_vars['detail']->value->type==0){?>
                                <a class="color-white" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/erp2016/controllers/<?php echo $_smarty_tpl->tpl_vars['detail']->value->tablename;?>
?do=showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
" target="_new">
                                    <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                </a>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==1){?>
                                <a class="color-white" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/erp2016/controllers/<?php echo $_smarty_tpl->tpl_vars['detail']->value->tablename;?>
?do=showDetail&returnsellbillid=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
" target="_new">
                                    <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                </a>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==2){?>
                                <a class="color-white" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/erp2016/controllers/<?php echo $_smarty_tpl->tpl_vars['detail']->value->tablename;?>
?do=<?php if ($_smarty_tpl->tpl_vars['detail']->value->type==0){?>showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==1){?>showDetail&returnsellbillid=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==2){?>showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==3){?>details&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==4){?>details&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==5){?>details&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==6){?>edit&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==7){?>edit&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==8){?>#<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==9){?>#<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==10){?>#<?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==11){?>#<?php }?>" target="_new">
                                    <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                </a>

                                <a class="color-white" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/erp2016/controllers/<?php echo $_smarty_tpl->tpl_vars['detail']->value->tablename;?>
?do=showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
" target="_new">
                                    <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                </a>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==3){?>
                                <a class="color-white" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/erp2016/controllers/<?php echo $_smarty_tpl->tpl_vars['detail']->value->tablename;?>
?do=details&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
" target="_new">
                                    <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                </a>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==4){?>
                                <a class="color-white" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/erp2016/controllers/<?php echo $_smarty_tpl->tpl_vars['detail']->value->tablename;?>
?do=details&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
" target="_new">
                                    <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                </a>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==5){?>
                                <a class="color-white" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/erp2016/controllers/<?php echo $_smarty_tpl->tpl_vars['detail']->value->tablename;?>
?do=details&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
" target="_new">
                                    <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                </a>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==6){?>
                                <a class="color-white" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/erp2016/controllers/<?php echo $_smarty_tpl->tpl_vars['detail']->value->tablename;?>
?do=edit&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
" target="_new">
                                    <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                </a>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==7){?>
                                <a class="color-white" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/erp2016/controllers/<?php echo $_smarty_tpl->tpl_vars['detail']->value->tablename;?>
?do=edit&id=<?php echo $_smarty_tpl->tpl_vars['detail']->value->modelid;?>
" target="_new">
                                    <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                </a>
                                <?php }else{ ?>
                                <?php echo $_smarty_tpl->tpl_vars['detail']->value->processname;?>

                                <?php }?>
                            </td>
                            <td>
                                <?php if ($_smarty_tpl->tpl_vars['detail']->value->type==0){?>
                                فاتورة مبيعات
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==1){?>
                                فاتورة مردود مبيعات
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==2){?>
                                فاتورة مبيعات و مردودها
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==3){?>
                                فاتورة مشتريات
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==4){?>
                                فاتورة مردود مشتريات
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==5){?>
                                فاتورة مشتريات و مردودها
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==6){?>
                                مصروفات
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==7){?>
                                إيرادات
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==8){?>
                                مرتبات
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==9){?>
                                سحب لموظف
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==10){?>
                                سلفة موظف
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==11){?>
                                سداد سلفة مباشرة
                                <?php }?>
                            </td>
                            <td><?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
</td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
                <?php }?>




                <?php if (!empty($_smarty_tpl->tpl_vars['allDetails']->value)&&$_smarty_tpl->tpl_vars['details']->value==1){?>
                <table class="table table-black">
                    <thead>
                        <tr >
                            <th>   إيرادات</th>
                            <th>مصروفات</th>                            
                        </tr>
                    </thead>
                    <tbody>
                         <?php $_smarty_tpl->tpl_vars['Revenues'] = new Smarty_variable(0, null, 0);?>
                          <?php $_smarty_tpl->tpl_vars['Expenses'] = new Smarty_variable(0, null, 0);?>
                        <?php  $_smarty_tpl->tpl_vars['detail'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['detail']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDetails']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['detail']->key => $_smarty_tpl->tpl_vars['detail']->value){
$_smarty_tpl->tpl_vars['detail']->_loop = true;
?>
                        <tr>
                            <td> 
                                <?php if ($_smarty_tpl->tpl_vars['detail']->value->type==0){?>
                                فاتورة مبيعات    : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                 <?php $_smarty_tpl->tpl_vars['Revenues'] = new Smarty_variable($_smarty_tpl->tpl_vars['Revenues']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==4){?>
                                فاتورة مردود مشتريات      : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Revenues'] = new Smarty_variable($_smarty_tpl->tpl_vars['Revenues']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                 <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==7){?>
                             إيرادات    : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Revenues'] = new Smarty_variable($_smarty_tpl->tpl_vars['Revenues']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                 <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==2&&$_smarty_tpl->tpl_vars['detail']->value->costamount>=0){?>
                                ف   فاتورة مبيعات و مردودها  : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Revenues'] = new Smarty_variable($_smarty_tpl->tpl_vars['Revenues']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==11){?>
                            سداد سلفة مباشرة : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Revenues'] = new Smarty_variable($_smarty_tpl->tpl_vars['Revenues']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                 <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==5&&$_smarty_tpl->tpl_vars['detail']->value->costamount>0){?>
                                  فاتورة مشتريات و مردودها   : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Revenues'] = new Smarty_variable($_smarty_tpl->tpl_vars['Revenues']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                <?php }else{ ?>
                                ***********************
                                <?php }?>
                            </td>
                            
                            <td>
                               <?php if ($_smarty_tpl->tpl_vars['detail']->value->type==1){?>
                                فاتورة مردود مبيعات    : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                             <?php $_smarty_tpl->tpl_vars['Expenses'] = new Smarty_variable($_smarty_tpl->tpl_vars['Expenses']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==3){?>
                                فاتورة مشتريات      : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Expenses'] = new Smarty_variable($_smarty_tpl->tpl_vars['Expenses']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                 <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==6){?>
                                فمصروفات   : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Expenses'] = new Smarty_variable($_smarty_tpl->tpl_vars['Expenses']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                 <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==5&&$_smarty_tpl->tpl_vars['detail']->value->costamount<0){?>
                                  فاتورة مشتريات و مردودها   : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Expenses'] = new Smarty_variable($_smarty_tpl->tpl_vars['Expenses']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>

                                 <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==8){?>
                                 مرتبات    : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Expenses'] = new Smarty_variable($_smarty_tpl->tpl_vars['Expenses']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                  <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==9){?>
                                سحب لموظف    : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Expenses'] = new Smarty_variable($_smarty_tpl->tpl_vars['Expenses']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==10){?>
                               سلفة موظف   : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Expenses'] = new Smarty_variable($_smarty_tpl->tpl_vars['Expenses']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>
                                <?php }elseif($_smarty_tpl->tpl_vars['detail']->value->type==2&&$_smarty_tpl->tpl_vars['detail']->value->costamount>=0){?>
                                ف   فاتورة مبيعات و مردودها  : <?php echo $_smarty_tpl->tpl_vars['detail']->value->costamount;?>
 
                                <?php $_smarty_tpl->tpl_vars['Expenses'] = new Smarty_variable($_smarty_tpl->tpl_vars['Expenses']->value+$_smarty_tpl->tpl_vars['detail']->value->costamount, null, 0);?>


                                <?php }else{ ?>
                                ***********************
                                <?php }?>
                            </td>
                        </tr>

                        <?php } ?>
                        <tr >
                            <td style="font-size: 25px"> 
                              اجمالى الايرادات  :    <?php echo $_smarty_tpl->tpl_vars['Revenues']->value;?>

                            </td>
                            
                            <td style="font-size: 25px">
                                اجمالى المصروفات:    <?php echo $_smarty_tpl->tpl_vars['Expenses']->value;?>

                            </td>
                        </tr>
                        <tr style="text-align: center;">
                              <td style="font-size: 25px" colspan="2">     الصافى  : <?php echo $_smarty_tpl->tpl_vars['Revenues']->value-$_smarty_tpl->tpl_vars['Expenses']->value;?>
  </td>
                        </tr>

                    </tbody>
                </table>
                <?php }?>


                <div class="clearfix"></div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    var spryselect2 = new Spry.Widget.allCostCenter("spryselect2", {invalidValue: "-1", isRequired: false});
</script>
<?php }} ?>