From 4b86947dd709a67c36b085e694cc6a48e911a5ec Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 May 2019 17:54:04 -0400 Subject: [PATCH] Removed invoice_id > 0 this was used to differentiate betweeen a recurring invoice and a normal invoice, recurring invoices have their own seperate table --- dashboard.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard.php b/dashboard.php index 441d9381..7d7b5cd2 100644 --- a/dashboard.php +++ b/dashboard.php @@ -15,11 +15,11 @@ if(isset($_GET['year'])){ } //GET THE YEARS -$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_payment_years = mysqli_query($mysqli,"SELECT DISTINCT YEAR(payment_date) AS payment_year FROM payments ORDER BY payment_year DESC"); //Get Total income Do not grab transfer payment as these have an invoice_id of 0 -$sql_total_income = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_income FROM payments WHERE invoice_id > 0 AND YEAR(payment_date) = $year"); +$sql_total_income = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_income FROM payments WHERE YEAR(payment_date) = $year"); $row = mysqli_fetch_array($sql_total_income); $total_income = $row['total_income'];