From b44719cc1a7cac49ef45944b9626512f114d1ced Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 14 Feb 2022 13:25:44 -0500 Subject: [PATCH] Added Last Years Income to Cash flow --- dashboard_financial.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dashboard_financial.php b/dashboard_financial.php index 006a732d..7c008965 100644 --- a/dashboard_financial.php +++ b/dashboard_financial.php @@ -509,6 +509,45 @@ var myLineChart = new Chart(ctx, { ], }, + { + label: "LY Income", + fill: false, + borderColor: "#9932CC", + pointBackgroundColor: "#9932CC", + pointBorderColor: "#9932CC", + pointHoverRadius: 5, + pointHoverBackgroundColor: "#9932CC", + pointHitRadius: 50, + pointBorderWidth: 2, + data: [ + 0 AND YEAR(revenue_date) = $year-1 AND MONTH(revenue_date) = $month AND company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_revenues); + $revenues_for_month = $row['revenue_amount_for_month']; + + $income_for_month = $payments_for_month + $revenues_for_month; + + if($income_for_month > 0 AND $income_for_month > $largest_income_month){ + $largest_income_month = $income_for_month; + } + + + ?> + + + + + ], + }, { label: "Projected", fill: false,