diff --git a/report_income_summary.php b/report_income_summary.php index f07634b6..b8c49b17 100644 --- a/report_income_summary.php +++ b/report_income_summary.php @@ -1,5 +1,5 @@ -
-
-

Income Summary

-
- +
+

Income Summary

+
+ +
-
-
-
- + -
+ while ($row = mysqli_fetch_array($sql_payment_years)) { + $payment_year = $row['payment_year']; + ?> + - + -
- - - - - - - - - - - - - - - - - - - - - + - ?> + - - - - +
CategoryJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberTotal
+ + + + + + + + + + + + + + + + + + + + - //Revenues - $sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenue_category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month"); - $row = mysqli_fetch_array($sql_revenues); - $revenues_amount_for_month = $row['revenue_amount_for_month']; + + - $payment_amount_for_month = $payment_amount_for_month + $revenues_amount_for_month; - $total_payment_for_all_months = $payment_amount_for_month + $total_payment_for_all_months; + - - - - - - - - - - - - 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id"); - $row = mysqli_fetch_array($sql_revenues); - $revenues_total_amount_for_month = $row['revenue_amount_for_month']; + //Revenues + $sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenue_category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month"); + $row = mysqli_fetch_array($sql_revenues); + $revenues_amount_for_month = $row['revenue_amount_for_month']; - $payment_total_amount_for_month = $payment_total_amount_for_month + $revenues_total_amount_for_month; + $payment_amount_for_month = $payment_amount_for_month + $revenues_amount_for_month; + $total_payment_for_all_months = $payment_amount_for_month + $total_payment_for_all_months; - $total_payment_for_all_months = $payment_total_amount_for_month + $total_payment_for_all_months; - - ?> + ?> + - - + ?> - - - -
CategoryJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberTotal
Total
+ + + + + + + Total + 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_revenues); + $revenues_total_amount_for_month = $row['revenue_amount_for_month']; + + $payment_total_amount_for_month = $payment_total_amount_for_month + $revenues_total_amount_for_month; + + + $total_payment_for_all_months = $payment_total_amount_for_month + $total_payment_for_all_months; + + ?> + + + + + + + + +
-
\ No newline at end of file +