'.$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(); $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 "); 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': $data['inv'][$get_invoices['filter']]['stuck'] += $get_invoices['total']; 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': $data['back'][$get_invoices['filter']]['stuck'] += $get_invoices['total']; break; } break; case '4': echo""; 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 "); 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': $data['bonds'][$get_invoices['filter']]['stuck'] += $get_invoices['total']; 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': $data['bond_back'][$get_invoices['filter']]['stuck'] += $get_invoices['total']; break; } break; case '4': echo""; break; } } ?>
| التاريخ | البيان | المتحصلات اليومية | الإيرادات - الفواتير | صافي الايرادات | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| كاش | شبكة | تحويل | إجمالي المتحصلات | عن فواتير / كاش / شبكة | عن فواتير/ محول من ارصدة دائنة للعملاء | إيرادات مرتجعة ( فاتورة مرتجعات ) | إجمالي الإيرادات | |||
| =$frist_day?> | فواتير | =$inv_cash?> | =$inv_card?> | =$nothing_for_now?> | =$inv_cash_card?> | =$inv_cash_card?> | =$inv_stuck?> | =-$back_total?> | =$inv_total?> | =$inv_free_vat_total?> |
| أرصدة دائنة للعملاء | =$bonds_cash?> | =$bonds_card?> | =$nothing_for_now?> | =$bonds_cash_card?> | ||||||
| إيرادات مرتجعة | =-$back_cash?> | =$back_card?> | =$nothing_for_now?> | =-$back_cash_card?> | ||||||
| مجموع | =$inv_bonds_cash - ($back_cash)?> | =$inv_bonds_card - ($back_card)?> | =$nothing_for_now?> | =$inv_bonds_total - ($back_cash_card)?> | ||||||
| المجموع الكلي | =round($t1,2)?> | =round($t2,2)?> | =round($t3,2)?> | =round($t4,2)?> | =round($t5,2)?> | =round($t6,2)?> | =round(-$t7,2)?> | =round($t8,2)?> | =round($t9,2)?> | |