From d6814ab05f5940d239b932ce3b83609c750d3b50 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 26 Apr 2019 17:06:24 -0400 Subject: [PATCH] Income and Expense Reports completed --- report_expense_summary.php | 136 +++++++++++++++++++++++-------------- report_income_summary.php | 136 +++++++++++++++++++++++-------------- 2 files changed, 168 insertions(+), 104 deletions(-) diff --git a/report_expense_summary.php b/report_expense_summary.php index 35b730cf..ede95e05 100644 --- a/report_expense_summary.php +++ b/report_expense_summary.php @@ -1,17 +1,37 @@ + +if(isset($_GET['year'])){ + $year = intval($_GET['year']); +}else{ + $year = date('Y'); +} +$sql_expense_years = mysqli_query($mysqli,"SELECT DISTINCT YEAR(expense_date) AS expense_year FROM expenses WHERE category_id > 0 ORDER BY expense_year DESC"); + +$sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Expense' ORDER BY category_name ASC"); + +?>
Expense Summary
- - + +
+ +
@@ -35,53 +55,65 @@ - - Expense Category Type - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - - - Expense Category Type 2 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - + + + + + + + $ + + + + $ + + + + Total - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 + 0"); + $row = mysqli_fetch_array($sql_expenses); + $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; + + + ?> + + $ + + + $ diff --git a/report_income_summary.php b/report_income_summary.php index ee5ebf15..6cde992d 100644 --- a/report_income_summary.php +++ b/report_income_summary.php @@ -1,17 +1,37 @@ + +if(isset($_GET['year'])){ + $year = intval($_GET['year']); +}else{ + $year = date('Y'); +} +$sql_payment_years = mysqli_query($mysqli,"SELECT DISTINCT YEAR(payment_date) AS payment_year FROM payments WHERE invoice_id > 0 ORDER BY payment_year DESC"); + +$sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' ORDER BY category_name ASC"); + +?>
Income Summary
- - + +
+ +
@@ -35,53 +55,65 @@ - - Income Category Type - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - - - Income Category Type 2 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - + + + + + + + $ + + + + $ + + + + Total - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 - $0.00 + + + $ + + + $