'.$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(); $error = 0; $get_invoices_sql = mysqli_query($db, "SELECT `r_month_user_invoices`.`filter`, `r_month_user_invoices`.`total`, `r_month_user_invoices`.`invoices_status_id`, `r_month_user_invoices`.`how_pay_id` FROM `r_month_user_invoices` INNER JOIN `branch` ON `branch`.`id` = `r_month_user_invoices`.`branch_id` WHERE DATE_FORMAT(`r_month_user_invoices`.`filter`, '%Y-%m') = '$today' AND `r_month_user_invoices`.`branch_id` $branch_sql AND `branch`.`commercial_register_id` $c_r_id_sql AND `branch`.`commercial_register_id` <> 5 "); if (mysqli_num_rows($get_invoices_sql) > 0) { while ($get_invoices = mysqli_fetch_assoc($get_invoices_sql)) { switch ($get_invoices['invoices_status_id']) { case '1': case '2': switch ($get_invoices['how_pay_id']) { case '1': $data['inv'][$get_invoices['filter']]['cash'] += $get_invoices['total']; break; case '2': $data['inv'][$get_invoices['filter']]['card'] += $get_invoices['total']; break; case '3': case '4': $data['inv'][$get_invoices['filter']]['stuck'] += $get_invoices['total']; break; case '6': case '7': case '8': case '9': case '10': $data['inv'][$get_invoices['filter']]['trans'] += $get_invoices['total']; break; default: $data['inv'][$get_invoices['filter']]['else'] += $get_invoices['total']; $error++; break; } break; case '3': switch ($get_invoices['how_pay_id']) { case '1': $data['back'][$get_invoices['filter']]['cash'] += $get_invoices['total']; break; case '2': $data['back'][$get_invoices['filter']]['card'] += $get_invoices['total']; break; case '3': case '4': $data['back'][$get_invoices['filter']]['stuck'] += $get_invoices['total']; break; case '5': $data['back'][$get_invoices['filter']]['trans'] += $get_invoices['total']; break; default: $data['back'][$get_invoices['filter']]['else'] += $get_invoices['total']; $error++; break; } break; default: $error++; break; } } } $get_invoices_sql = mysqli_query($db, "SELECT `r_month_user_bonds`.`filter`, `r_month_user_bonds`.`total`, `r_month_user_bonds`.`bonds_status_id`, `r_month_user_bonds`.`how_pay_id` FROM `r_month_user_bonds` INNER JOIN `branch` ON `branch`.`id` = `r_month_user_bonds`.`branch_id` WHERE DATE_FORMAT(`r_month_user_bonds`.`filter`, '%Y-%m') = '$today' AND `r_month_user_bonds`.`branch_id` $branch_sql AND `branch`.`commercial_register_id` $c_r_id_sql AND `branch`.`commercial_register_id` <> 5 "); if (mysqli_num_rows($get_invoices_sql) > 0) { while ($get_invoices = mysqli_fetch_assoc($get_invoices_sql)) { switch ($get_invoices['bonds_status_id']) { case '1': case '2': switch ($get_invoices['how_pay_id']) { case '1': $data['bonds'][$get_invoices['filter']]['cash'] += $get_invoices['total']; break; case '2': $data['bonds'][$get_invoices['filter']]['card'] += $get_invoices['total']; break; case '3': case '4': $data['bonds'][$get_invoices['filter']]['stuck'] += $get_invoices['total']; break; case '6': case '7': case '8': case '9': case '10': $data['bonds'][$get_invoices['filter']]['trans'] += $get_invoices['total']; break; default: $data['bonds'][$get_invoices['filter']]['else'] += $get_invoices['total']; $error++; break; } break; case '3': switch ($get_invoices['how_pay_id']) { case '1': $data['bond_back'][$get_invoices['filter']]['cash'] += $get_invoices['total']; break; case '2': $data['bond_back'][$get_invoices['filter']]['card'] += $get_invoices['total']; break; case '3': case '4': $data['bond_back'][$get_invoices['filter']]['stuck'] += $get_invoices['total']; break; case '5': $data['bond_back'][$get_invoices['filter']]['trans'] += $get_invoices['total']; break; default: $data['bond_back'][$get_invoices['filter']]['else'] += $get_invoices['total']; $error++; break; } break; default: $error++; break; } } } ?>

إيرادات شهر

-
+
طلب التقرير
عدد الأخطاء
التاريخ عن فواتير / كاش / شبكة غير شامل الضريبة عن فواتير/ محول من ارصدة دائنة للعملاء غير شامل الضريبة إجمالي الإيرادات بدون الضريبة
عن فواتير / كاش / شبكة غير شامل الضريبة الضريبة عن فواتير 15%
المجموع الكلي