Removed invoice_id > 0 this was used to differentiate betweeen a recurring invoice and a normal invoice, recurring invoices have their own seperate table

This commit is contained in:
root 2019-05-29 17:54:04 -04:00
parent e7f807af50
commit 4b86947dd7
1 changed files with 2 additions and 2 deletions

View File

@ -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'];