Fixed Calculation in expense report same issue as below
This commit is contained in:
@@ -98,7 +98,7 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
for($month = 1; $month<=12; $month++) {
|
for($month = 1; $month<=12; $month++) {
|
||||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND category_id > 0");
|
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0");
|
||||||
$row = mysqli_fetch_array($sql_expenses);
|
$row = mysqli_fetch_array($sql_expenses);
|
||||||
$expense_total_amount_for_month = $row['expense_total_amount_for_month'];
|
$expense_total_amount_for_month = $row['expense_total_amount_for_month'];
|
||||||
$total_expense_for_all_months = $expense_total_amount_for_month + $total_expense_for_all_months;
|
$total_expense_for_all_months = $expense_total_amount_for_month + $total_expense_for_all_months;
|
||||||
|
|||||||
Reference in New Issue
Block a user