mirror of https://github.com/itflow-org/itflow
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:
parent
e7f807af50
commit
4b86947dd7
|
|
@ -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'];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue