727 lines
36 KiB
PHP
Executable File
727 lines
36 KiB
PHP
Executable File
<?php
|
|
require_once('fixed/config/go_con.php');
|
|
access(30);
|
|
|
|
$today = date("Y-m");
|
|
if (!empty($_GET['date'])) {
|
|
$today = $_GET['date'];
|
|
if (DateTime::createFromFormat('Y-m', $today) == false) {
|
|
$today = date("Y-m");
|
|
}
|
|
}
|
|
|
|
$c_r_id = $_GET['c'];
|
|
if (!empty($_GET['c'])) {
|
|
$c_r_id = $_GET['c'];
|
|
if (!is_numeric($c_r_id)) {
|
|
$c_r_id = 1;
|
|
}
|
|
} else {
|
|
$c_r_id = 1;
|
|
}
|
|
$c_r_id_sql = '=' . $c_r_id;
|
|
if ($c_r_id == 1) {
|
|
$c_r_id_sql = '<>' . $c_r_id;
|
|
}
|
|
|
|
$branch_id = $_GET['b'];
|
|
if (!empty($_GET['b'])) {
|
|
$branch_id = $_GET['b'];
|
|
if (!is_numeric($branch_id)) {
|
|
$branch_id = 1;
|
|
}
|
|
} else {
|
|
$branch_id = 1;
|
|
}
|
|
if (!empty($_GET['f'])) {
|
|
if (is_numeric($c_r_id) && $_GET['f'] == 1) {
|
|
$branch_id = 1;
|
|
}
|
|
}
|
|
$branch_sql = '=' . $branch_id;
|
|
if ($branch_id == 1) {
|
|
$branch_sql = '<>' . $branch_id;
|
|
}
|
|
|
|
$data = array();
|
|
|
|
$Next = date('Y-m', strtotime('+1 month', strtotime($today)));
|
|
$Previous = date('Y-m', strtotime('-1 month', strtotime($today)));
|
|
|
|
$startDate = new DateTime($today . '-01');
|
|
$endDate = clone $startDate;
|
|
|
|
$endDate->modify('last day of this month');
|
|
|
|
while ($startDate <= $endDate) {
|
|
$startDate->format('Y-m-d');
|
|
$today_temp = $startDate->format('Y-m-d');
|
|
$Next_temp = date('Y-m-d', strtotime('+1 day', strtotime($today_temp)));
|
|
|
|
|
|
$get_invoices_sql = mysqli_query(
|
|
$db,
|
|
"SELECT
|
|
`user`.`name`, `branch`.`branch_name`, `invoices_details`.`invoices_status_id`, `invoices_details_has_how_pay`.`user_id`, `invoices_details`.`branch_id`, `invoices_details_has_how_pay`.`how_pay_id`, SUM(`invoices_details_has_how_pay`.`pay`) AS `pay`, COUNT(`invoices`.`id`) AS `count`
|
|
FROM `invoices_details_has_how_pay`
|
|
INNER JOIN `invoices_details` ON `invoices_details_has_how_pay`.`invoices_details_id` = `invoices_details`.`id`
|
|
INNER JOIN `invoices` ON `invoices_details`.`invoices_id` = `invoices`.`id`
|
|
INNER JOIN `user` ON `invoices_details_has_how_pay`.`user_id` = `user`.`id`
|
|
INNER JOIN `branch` ON `invoices_details`.`branch_id` = `branch`.`id`
|
|
WHERE ((`invoices_details_has_how_pay`.`date_time` LIKE '$today_temp%' AND `invoices_details_has_how_pay`.`date_time` >= '$today_temp 03:00:00') OR (`invoices_details_has_how_pay`.`date_time` LIKE '$Next_temp%' AND `invoices_details_has_how_pay`.`date_time` < '$Next_temp 03:00:00'))
|
|
AND `branch`.`id` $branch_sql
|
|
AND `branch`.`commercial_register_id` $c_r_id_sql
|
|
GROUP BY `invoices_details_has_how_pay`.`user_id`,
|
|
`invoices_details`.`branch_id`,
|
|
`invoices_details`.`invoices_status_id`,
|
|
`invoices_details_has_how_pay`.`how_pay_id`
|
|
ORDER BY `invoices_details`.`branch_id`
|
|
"
|
|
);
|
|
|
|
if (mysqli_num_rows($get_invoices_sql) > 0) {
|
|
while ($get_invoices = mysqli_fetch_assoc($get_invoices_sql)) {
|
|
$data[$get_invoices['user_id']]['info']['name'] = $get_invoices['name'];
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['info']['name'] = $get_invoices['branch_name'];
|
|
switch ($get_invoices['invoices_status_id']) {
|
|
case '1':
|
|
case '2':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv']['count'] += $get_invoices['count'];
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv']['cash'] += $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv']['card'] += $get_invoices['pay'];
|
|
break;
|
|
case '3':
|
|
case '4':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv']['stuck'] += $get_invoices['pay'];
|
|
break;
|
|
case '6':
|
|
case '7':
|
|
case '8':
|
|
case '9':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv']['trans'] += $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv']['else'] += $get_invoices['pay'];
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
case '3':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv_back']['count'] += $get_invoices['count'];
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv_back']['cash'] += $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv_back']['card'] += $get_invoices['pay'];
|
|
break;
|
|
case '3':
|
|
case '4':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv_back']['stuck'] += $get_invoices['pay'];
|
|
break;
|
|
case '5':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv_back']['trans'] += $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['inv_back']['else'] += $get_invoices['pay'];
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
$get_invoices_sql = mysqli_query(
|
|
$db,
|
|
"SELECT
|
|
`user`.`name`, `branch`.`branch_name`, `bonds_details`.`bonds_status_id`, `bonds_details_has_how_pay`.`user_id`, `bonds_details`.`branch_id`, `bonds_details_has_how_pay`.`how_pay_id`, SUM(`bonds_details_has_how_pay`.`pay`) AS `pay`, COUNT(`bonds`.`id`) AS `count`
|
|
FROM `bonds_details_has_how_pay`
|
|
INNER JOIN `bonds_details` ON `bonds_details_has_how_pay`.`bonds_details_id` = `bonds_details`.`id`
|
|
INNER JOIN `bonds` ON `bonds_details`.`bonds_id` = `bonds`.`id`
|
|
INNER JOIN `user` ON `bonds_details_has_how_pay`.`user_id` = `user`.`id`
|
|
INNER JOIN `branch` ON `bonds_details`.`branch_id` = `branch`.`id`
|
|
WHERE ((`bonds_details_has_how_pay`.`date_time` LIKE '$today_temp%' AND `bonds_details_has_how_pay`.`date_time` >= '$today_temp 03:00:00') OR (`bonds_details_has_how_pay`.`date_time` LIKE '$Next_temp%' AND `bonds_details_has_how_pay`.`date_time` < '$Next_temp 03:00:00'))
|
|
AND `branch`.`id` $branch_sql
|
|
AND `branch`.`commercial_register_id` $c_r_id_sql
|
|
GROUP BY `bonds_details_has_how_pay`.`user_id`,
|
|
`bonds_details`.`branch_id`,
|
|
`bonds_details`.`bonds_status_id`,
|
|
`bonds_details_has_how_pay`.`how_pay_id`
|
|
ORDER BY `bonds_details`.`branch_id`
|
|
"
|
|
);
|
|
if (mysqli_num_rows($get_invoices_sql) > 0) {
|
|
while ($get_invoices = mysqli_fetch_assoc($get_invoices_sql)) {
|
|
$data[$get_invoices['user_id']]['info']['name'] = $get_invoices['name'];
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['info']['name'] = $get_invoices['branch_name'];
|
|
switch ($get_invoices['bonds_status_id']) {
|
|
case '1':
|
|
case '2':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds']['count'] += $get_invoices['count'];
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds']['cash'] += $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds']['card'] += $get_invoices['pay'];
|
|
break;
|
|
case '3':
|
|
case '4':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds']['stuck'] += $get_invoices['pay'];
|
|
break;
|
|
case '6':
|
|
case '7':
|
|
case '8':
|
|
case '9':
|
|
case '10':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds']['trans'] += $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds']['else'] += $get_invoices['pay'];
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
case '3':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds_back']['count'] += $get_invoices['count'];
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds_back']['cash'] += $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds_back']['card'] += $get_invoices['pay'];
|
|
break;
|
|
case '3':
|
|
case '4':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds_back']['stuck'] += $get_invoices['pay'];
|
|
break;
|
|
case '5':
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds_back']['trans'] += $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$data[$get_invoices['user_id']]['branchs'][$get_invoices['branch_id']]['bonds_back']['else'] += $get_invoices['pay'];
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
$startDate->modify('+1 day');
|
|
}
|
|
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en" dir="rtl">
|
|
<?php require_once('fixed/head/go.php'); ?>
|
|
|
|
<body class="rtl">
|
|
<style>
|
|
tr {
|
|
border-color: #bfbbbb !important;
|
|
}
|
|
|
|
.table-bordered td,
|
|
.table-bordered th {
|
|
border-color: #bfbbbb !important;
|
|
}
|
|
</style>
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@mdi/font@6.5.95/css/materialdesignicons.min.css">
|
|
<?php require_once('fixed/loader/go.php'); ?>
|
|
<!-- page-wrapper Start-->
|
|
<div class="page-wrapper" id="pageWrapper">
|
|
<?php require_once('fixed/header/go.php'); ?>
|
|
<!-- Page Body Start-->
|
|
<div class="page-body-wrapper">
|
|
<?php require_once('fixed/sidebar/go.php'); ?>
|
|
<div class="page-body">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-12 col-sm-12 col-md-12 col-lg-2 col-xl-2">
|
|
<div class="card">
|
|
<div class="card-body new-user order-list profile-nav">
|
|
<div class="nav flex-column nav-pills" id="profile-tab" aria-orientation="vertical">
|
|
<a class="nav-link mb-0 <?php if ($c_r_id == 1) {
|
|
echo 'active';
|
|
} ?> ?>" data-toggle="pill" href="#cr_1"
|
|
aria-selected="false"
|
|
onclick="window.location='custom_reports?s=47&date=<?= $today ?>&b=<?= $branch_id ?>&c=1&f=1'">الكل</a>
|
|
<a class="nav-link mb-0 <?php if ($c_r_id == 2) {
|
|
echo 'active';
|
|
} ?> ?>" data-toggle="pill" href="#cr_2"
|
|
aria-selected="false"
|
|
onclick="window.location='custom_reports?s=47&date=<?= $today ?>&b=<?= $branch_id ?>&c=2&f=1'">القسم
|
|
الرجالي</a>
|
|
<a class="nav-link mb-0 <?php if ($c_r_id == 3) {
|
|
echo 'active';
|
|
} ?> ?>" data-toggle="pill" href="#cr_3"
|
|
aria-selected="false"
|
|
onclick="window.location='custom_reports?s=47&date=<?= $today ?>&b=<?= $branch_id ?>&c=3&f=1'">القسم
|
|
النسائي</a>
|
|
<a class="nav-link mb-0 <?php if ($c_r_id == 4) {
|
|
echo 'active';
|
|
} ?> ?>" data-toggle="pill" href="#cr_4"
|
|
aria-selected="false"
|
|
onclick="window.location='custom_reports?s=47&date=<?= $today ?>&b=<?= $branch_id ?>&c=4&f=1'">القسم
|
|
الزيارات</a>
|
|
<a class="nav-link mb-0 <?php if ($c_r_id == 5) {
|
|
echo 'active';
|
|
} ?> ?>" data-toggle="pill" href="#cr_5"
|
|
aria-selected="false"
|
|
onclick="window.location='custom_reports?s=47&date=<?= $today ?>&b=<?= $branch_id ?>&c=5&f=1'">القسم
|
|
الطبيعي</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card">
|
|
<div class="card-body new-user order-list profile-nav">
|
|
<div class="nav flex-column nav-pills" id="profile-tab" aria-orientation="vertical">
|
|
<?php
|
|
$commercial_register_sql = mysqli_query($db, "SELECT `branch`.`branch_name`, `branch`.`id`
|
|
FROM `commercial_register`
|
|
LEFT JOIN `branch` ON `commercial_register`.`id` = `branch`.`commercial_register_id`
|
|
WHERE `commercial_register`.`id` $c_r_id_sql
|
|
OR `branch`.`id` = 1
|
|
");
|
|
while ($commercial_register = mysqli_fetch_assoc($commercial_register_sql)) {
|
|
?>
|
|
<a class="nav-link mb-0 <?php if ($branch_id == $commercial_register['id']) {
|
|
echo 'active';
|
|
} ?> ?>"
|
|
data-toggle="pill" href="#branch-<?= $commercial_register['id'] ?>" aria-selected="false"
|
|
onclick="window.location='custom_reports?s=47&date=<?= $today ?>&b=<?= $commercial_register['id'] ?>&c=<?= $c_r_id ?>'"><?= $commercial_register['branch_name'] ?></a>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-12 col-md-12 col-lg-10 col-xl-10">
|
|
<div class="card">
|
|
<div class="card-body new-user order-list text-center">
|
|
<div class="row">
|
|
<div class="col-12 col-sm-12 col-md-3 col-lg-4 col-xl-4">
|
|
</div>
|
|
<div class="page-title mb-3 col-12 col-sm-12 col-md-6 col-lg-4 col-xl-4">
|
|
<i class="mdi mdi-monitor mr-2">
|
|
</i>
|
|
<h4>
|
|
إيرادات شهر
|
|
<?= $today ?>
|
|
</h4>
|
|
</div>
|
|
<div class="col-12 col-sm-12 col-md-3 col-lg-4 col-xl-4">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-12 col-sm-12 col-md-2 col-lg-3 col-xl-3">
|
|
</div>
|
|
<div class="col-2 col-sm-2 col-md-1 col-lg-1 col-xl-1">
|
|
<a class="btn btn-danger btn-round waves-effect waves-light col-12"
|
|
href="custom_reports?s=47&date=<?= $Previous ?>&b=<?= $branch_id ?>"
|
|
style="padding: 0.375rem 0.75rem;">-</a>
|
|
</div>
|
|
<div class="col-8 col-sm-8 col-md-6 col-lg-4 col-xl-4">
|
|
<input id="Select-date" class="form-control" type="date" value=""
|
|
style="text-align: center !important;">
|
|
</div>
|
|
<div class="col-2 col-sm-2 col-md-1 col-lg-1 col-xl-1">
|
|
<a class="btn btn-primary btn-round waves-effect waves-light col-12"
|
|
href="custom_reports?s=47&date=<?= $Next ?>&b=<?= $branch_id ?>" style="padding: 0.375rem 0.75rem;">+</a>
|
|
</div>
|
|
<div class="col-12 col-sm-12 col-md-2 col-lg-3 col-xl-3">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body new-user order-list">
|
|
<h6>تفاصيل التقرير</h6>
|
|
<ol>
|
|
<li>
|
|
التقرير لا يظهر في عمود إيرادات مرتجعة
|
|
<ol>
|
|
<li>التحويل</li>
|
|
<li>مرتجع ل رصيد</li>
|
|
</ol>
|
|
</li>
|
|
<li>
|
|
التقرير لا يظهر في عمود مرتجع أرصدة دائنة
|
|
<ol>
|
|
<li>التحويل</li>
|
|
<li>مرتجع ل رصيد</li>
|
|
</ol>
|
|
</li>
|
|
<li>
|
|
المقصود ب اخرى هي عمليات الدفع التي لم يتم تعريفها في التقرير
|
|
</li>
|
|
<li>
|
|
<b style="color:red">
|
|
تنبية :
|
|
</b>
|
|
عند وجود اي خطأ في (عدد الاخطاء) يرجى اشعار القسم التقني
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
<div class="tab-content">
|
|
<div class="tab-pane p-3 active" id="tab<?= $tabs ?>" role="tabpanel">
|
|
<div class="card-body new-user order-list">
|
|
<div class="table-responsive">
|
|
عدد الأخطاء
|
|
|
|
<table class="table table-bordered text-center" style="vertical-align: middle;">
|
|
<thead class="table-primary" style="vertical-align: middle;">
|
|
<tr>
|
|
<th rowspan="2" scope="col">#</th>
|
|
<th rowspan="2" scope="col">اسم الموظف</th>
|
|
<th rowspan="2" scope="col">الفرع</th>
|
|
<th rowspan="2" scope="col">بيان</th>
|
|
<th rowspan="2" scope="col">عدد العمليات</th>
|
|
<th colspan="5" scope="col">المتحصلات اليومية</th>
|
|
<th colspan="4" scope="col">الإيرادات - الفواتير</th>
|
|
<th rowspan="2" scope="col">ايداعات نقدية عن طريق الموظف</th>
|
|
<th rowspan="2" scope="col">العجز / الزيادة</th>
|
|
<th rowspan="2" scope="col">ملاحظات</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col">كاش</th>
|
|
<th scope="col">شبكة</th>
|
|
<th scope="col">تحويل</th>
|
|
<th scope="col">اخرى</th>
|
|
<th scope="col">إجمالي المتحصلات</th>
|
|
<th scope="col">عن فواتير / كاش / شبكة</th>
|
|
<th scope="col">عن فواتير/ محول من ارصدة دائنة للعملاء</th>
|
|
<th scope="col">إيرادات مرتجعة ( فاتورة مرتجعات )</th>
|
|
<th scope="col">إجمالي الإيرادات</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$count = 1;
|
|
$t1_1 = 0;
|
|
$t1_2 = 0;
|
|
$t1_3 = 0;
|
|
$t1_4 = 0;
|
|
$t1_5 = 0;
|
|
$t1_2_4 = 0;
|
|
|
|
$t2_1 = 0;
|
|
$t2_2 = 0;
|
|
$t2_3 = 0;
|
|
$t2_4 = 0;
|
|
$t2_5 = 0;
|
|
$t2_2_3 = 0;
|
|
|
|
$t3_1 = 0;
|
|
$t3_2 = 0;
|
|
$t3_3 = 0;
|
|
$t3_4 = 0;
|
|
$t3_5 = 0;
|
|
$t3_2_4 = 0;
|
|
|
|
$t4_1 = 0;
|
|
$t4_2 = 0;
|
|
$t4_3 = 0;
|
|
$t4_4 = 0;
|
|
$t4_5 = 0;
|
|
$t4_2_3 = 0;
|
|
|
|
$t5_1 = 0;
|
|
$t5_2 = 0;
|
|
$t5_3 = 0;
|
|
$t5_4 = 0;
|
|
$t5_5 = 0;
|
|
$t5_2_4 = 0;
|
|
|
|
$s1 = 0;
|
|
$s2 = 0;
|
|
$s3 = 0;
|
|
$s4 = 0;
|
|
|
|
$Zeroo = 0;
|
|
foreach ($data as $key => $value) {
|
|
?>
|
|
<tr>
|
|
<th rowspan="<?= count($data[$key]['branchs']) * 5 ?>" scope="row"><?= $count ?></th>
|
|
<td rowspan="<?= count($data[$key]['branchs']) * 5 ?>"><a
|
|
href="daily_user_d?u=<?= $key ?>&d=<?= $today ?>"><?= $data[$key]['info']['name'] ?></a>
|
|
</td>
|
|
<?php
|
|
foreach ($data[$key]['branchs'] as $key2 => $value2) {
|
|
|
|
// every 5 is not add in total
|
|
|
|
$t1_1_temp = round($data[$key]['branchs'][$key2]['inv']['count']);
|
|
$t1_2_temp = round($data[$key]['branchs'][$key2]['inv']['cash'], 2);
|
|
$t1_3_temp = round($data[$key]['branchs'][$key2]['inv']['card'], 2);
|
|
$t1_4_temp = round($data[$key]['branchs'][$key2]['inv']['trans'], 2);
|
|
$t1_5_temp = round($data[$key]['branchs'][$key2]['inv']['else'], 2);
|
|
$t2_4_total = $t1_2_temp + $t1_3_temp + $t1_4_temp;
|
|
$inv_stuck = round($data[$key]['branchs'][$key2]['inv']['stuck'], 2);
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
$t2_1_temp = round(($data[$key]['branchs'][$key2]['inv_back']['count']));
|
|
$t2_2_temp = round((($data[$key]['branchs'][$key2]['inv_back']['cash'])), 2);
|
|
$t2_3_temp = round((($data[$key]['branchs'][$key2]['inv_back']['card'])), 2);
|
|
$t2_4_temp = round((($data[$key]['branchs'][$key2]['inv_back']['trans'])), 2);
|
|
$t2_5_temp = round((($data[$key]['branchs'][$key2]['inv_back']['else'])), 2);
|
|
// مرتجع لرصيد
|
|
$inv_back_stuck = round((($data[$key]['branchs'][$key2]['inv_back']['stuck'])), 2);
|
|
// التحويل لا يتم خصمة من المتحصلات
|
|
$t6_7_total = $t2_2_temp + $t2_3_temp;
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
$t3_1_temp = round($data[$key]['branchs'][$key2]['bonds']['count']);
|
|
$t3_2_temp = round($data[$key]['branchs'][$key2]['bonds']['cash'], 2);
|
|
$t3_3_temp = round($data[$key]['branchs'][$key2]['bonds']['card'], 2);
|
|
$t3_4_temp = round($data[$key]['branchs'][$key2]['bonds']['trans'], 2);
|
|
$t3_5_temp = round($data[$key]['branchs'][$key2]['bonds']['else'], 2);
|
|
$t10_12_total = $t3_2_temp + $t3_3_temp + $t3_4_temp;
|
|
$bonds_stuck = round($data[$key]['branchs'][$key2]['bonds']['stuck'], 2);
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
$t4_1_temp = round($data[$key]['branchs'][$key2]['bonds_back']['count']);
|
|
$t4_2_temp = round($data[$key]['branchs'][$key2]['bonds_back']['cash'], 2);
|
|
$t4_3_temp = round($data[$key]['branchs'][$key2]['bonds_back']['card'], 2);
|
|
$t4_4_temp = round($data[$key]['branchs'][$key2]['bonds_back']['trans'], 2);
|
|
$t4_5_temp = round($data[$key]['branchs'][$key2]['bonds_back']['else'], 2);
|
|
// مرتجع لرصيد
|
|
$bonds_back_stuck = round($data[$key]['branchs'][$key2]['bonds_back']['stuck'], 2);
|
|
// التحويل لا يتم خصمة من المتحصلات
|
|
$t14_15_total = $t4_2_temp + $t4_3_temp;
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
$t5_1_temp = $t1_1_temp + $t2_1_temp + $t3_1_temp + $t4_1_temp;
|
|
$t5_2_temp = ($t1_2_temp - $t2_2_temp) + ($t3_2_temp - $t4_2_temp);
|
|
$t5_3_temp = ($t1_3_temp - $t2_3_temp) + ($t3_3_temp - $t4_3_temp);
|
|
$t5_4_temp = $t1_4_temp + $t3_4_temp;
|
|
$t5_5_temp = ($t1_5_temp - $t2_5_temp) + ($t3_5_temp - $t4_5_temp);
|
|
$t18_20_total = $t5_2_temp + $t5_3_temp + $t5_4_temp;
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
$s1_temp = $t2_4_total;
|
|
$s2_temp = $inv_stuck;
|
|
$s3_temp = $t2_2_temp + $t2_3_temp + $t2_4_temp + $inv_back_stuck;
|
|
$s4_temp = ($s1_temp + $s2_temp) - $s3_temp;
|
|
|
|
?>
|
|
<td rowspan="5"><?= $data[$key]['branchs'][$key2]['info']['name'] ?></td>
|
|
<td>فواتير</td>
|
|
<td><?= $t1_1_temp ?></td>
|
|
<td><?= $t1_2_temp ?></td>
|
|
<td><?= $t1_3_temp ?></td>
|
|
<td><?= $t1_4_temp ?></td>
|
|
<td style="background:#f7d1d1;"><?= $t1_5_temp ?></td>
|
|
<td style="background:#e9f0ee;"><b><?= round($t2_4_total, 2) ?></b></td>
|
|
<td rowspan="5"><?= $s1_temp ?></td>
|
|
<td rowspan="5"><?= $s2_temp ?></td>
|
|
<td rowspan="5">-<?= $s3_temp ?></td>
|
|
<td style="background:#e9f0ee;" rowspan="5"><?= $s4_temp ?></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>إيرادات مرتجعة</td>
|
|
<td><?= $t2_1_temp ?></td>
|
|
<td>-<?= $t2_2_temp ?></td>
|
|
<td>-<?= $t2_3_temp ?></td>
|
|
<td style="background:#f7d1d1;">-<?= $Zeroo ?></td>
|
|
<td style="background:#f7d1d1;">-<?= $t2_5_temp ?></td>
|
|
<td style="background:#e9f0ee;"><b>-<?= $t6_7_total ?></b></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>أرصدة دائنة للعملاء</td>
|
|
<td><?= $t3_1_temp ?></td>
|
|
<td><?= $t3_2_temp ?></td>
|
|
<td><?= $t3_3_temp ?></td>
|
|
<td><?= $t3_4_temp ?></td>
|
|
<td style="background:#f7d1d1;"><?= $t3_5_temp ?></td>
|
|
<td style="background:#e9f0ee;"><b><?= round($t10_12_total, 2) ?></b></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>مرتجع أرصدة دائنة</td>
|
|
<td><?= $t4_1_temp ?></td>
|
|
<td>-<?= $t4_2_temp ?></td>
|
|
<td>-<?= $t4_3_temp ?></td>
|
|
<td style="background:#f7d1d1;">-<?= $Zeroo ?></td>
|
|
<td style="background:#f7d1d1;">-<?= $t4_5_temp ?></td>
|
|
<td style="background:#e9f0ee;"><b>-<?= round($t14_15_total, 2) ?></b></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr style="background:#e9f0ee; font-weight: bold;">
|
|
<td>مجموع</td>
|
|
<td><?= $t5_1_temp ?></td>
|
|
<td><?= $t5_2_temp ?></td>
|
|
<td><?= $t5_3_temp ?></td>
|
|
<td><?= $t5_4_temp ?></td>
|
|
<td style="background:#f7d1d1;"><?= $t5_5_temp ?></td>
|
|
<td style="background:#e9f0ee;"><b><?= $t18_20_total ?></b></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<?php
|
|
$t1_1 += $t1_1_temp;
|
|
$t1_2 += $t1_2_temp;
|
|
$t1_3 += $t1_3_temp;
|
|
$t1_4 += $t1_4_temp;
|
|
$t1_5 += $t1_5_temp;
|
|
$t1_2_4 += $t2_4_total;
|
|
|
|
$t2_1 += $t2_1_temp;
|
|
$t2_2 += $t2_2_temp;
|
|
$t2_3 += $t2_3_temp;
|
|
$t2_4 += $t2_4_temp;
|
|
$t2_5 += $t2_5_temp;
|
|
$t2_2_3 += $t6_7_total;
|
|
|
|
$t3_1 += $t3_1_temp;
|
|
$t3_2 += $t3_2_temp;
|
|
$t3_3 += $t3_3_temp;
|
|
$t3_4 += $t3_4_temp;
|
|
$t3_5 += $t3_5_temp;
|
|
$t3_2_4 += $t10_12_total;
|
|
|
|
$t4_1 += $t4_1_temp;
|
|
$t4_2 += $t4_2_temp;
|
|
$t4_3 += $t4_3_temp;
|
|
$t4_4 += $t4_4_temp;
|
|
$t4_5 += $t4_5_temp;
|
|
$t4_2_3 += $t14_15_total;
|
|
|
|
$t5_1 += $t5_1_temp;
|
|
$t5_2 += $t5_2_temp;
|
|
$t5_3 += $t5_3_temp;
|
|
$t5_4 += $t5_4_temp;
|
|
$t5_5 += $t5_5_temp;
|
|
$t5_2_4 += $t18_20_total;
|
|
|
|
$s1 += $s1_temp;
|
|
$s2 += $s2_temp;
|
|
$s3 += $s3_temp;
|
|
$s4 += $s4_temp;
|
|
}
|
|
$count++;
|
|
}
|
|
?>
|
|
<tr>
|
|
<td rowspan="6" colspan="3">المجموع الكلي</td>
|
|
</tr>
|
|
<tr>
|
|
<td>فواتير</td>
|
|
<td><?= $t1_1 ?></td>
|
|
<td><?= $t1_2 ?></td>
|
|
<td><?= $t1_3 ?></td>
|
|
<td><?= $t1_4 ?></td>
|
|
<td style="background:#f7d1d1;"><?= $t1_5 ?></td>
|
|
<td style="background:#e9f0ee;"><?= $t1_2_4 ?></td>
|
|
<td rowspan="5"><?= $s1 ?></td>
|
|
<td rowspan="5"><?= $s2 ?></td>
|
|
<td rowspan="5">-<?= $s3 ?></td>
|
|
<td rowspan="5" style="background:#e9f0ee;"><?= $s4 ?></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>إيرادات مرتجعة</td>
|
|
<td><?= $t2_1 ?></td>
|
|
<td>-<?= $t2_2 ?></td>
|
|
<td>-<?= $t2_3 ?></td>
|
|
<td style="background:#f7d1d1;">-<?= $Zeroo ?></td>
|
|
<td style="background:#f7d1d1;">-<?= $t2_5 ?></td>
|
|
<td style="background:#e9f0ee;">-<?= $t2_2_3 ?></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>أرصدة دائنة للعملاء</td>
|
|
<td><?= $t3_1 ?></td>
|
|
<td><?= $t3_2 ?></td>
|
|
<td><?= $t3_3 ?></td>
|
|
<td><?= $t3_4 ?></td>
|
|
<td style="background:#f7d1d1;"><?= $t3_5 ?></td>
|
|
<td style="background:#e9f0ee;"><?= $t3_2_4 ?></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>مرتجع أرصدة دائنة</td>
|
|
<td><?= $t4_1 ?></td>
|
|
<td>-<?= $t4_2 ?></td>
|
|
<td>-<?= $t4_3 ?></td>
|
|
<td style="background:#f7d1d1;">-<?= $Zeroo ?></td>
|
|
<td style="background:#f7d1d1;">-<?= $t4_5 ?></td>
|
|
<td style="background:#e9f0ee;">-<?= $t4_2_3 ?></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="background:#e9f0ee;">مجموع</td>
|
|
<td style="background:#e9f0ee;"><?= $t5_1 ?></td>
|
|
<td style="background:#e9f0ee;"><?= $t5_2 ?></td>
|
|
<td style="background:#e9f0ee;"><?= $t5_3 ?></td>
|
|
<td style="background:#e9f0ee;"><?= $t5_4 ?></td>
|
|
<td style="background:#f7d1d1;"><?= $t5_5 ?></td>
|
|
<td style="background:#e9f0ee;"><?= $t5_2_4 ?></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php require_once('fixed/footer/go.php'); ?>
|
|
</div>
|
|
</div>
|
|
<?php require_once('fixed/js/go.php'); ?>
|
|
<script>
|
|
$("#Select-date").change(function () {
|
|
var SelectedDate = $(this).val();
|
|
window.location = 'custom_reports?s=47&b=<?= $branch_id ?>&date=' + SelectedDate
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|