Do not add Cancelled or Draft invoices to the projected amount in dashboard

This commit is contained in:
johnny@pittpc.com 2021-01-15 18:24:42 -05:00
parent b4cc8c1a91
commit b4b1326c99
1 changed files with 1 additions and 1 deletions

View File

@ -485,7 +485,7 @@ var myLineChart = new Chart(ctx, {
data: [
<?php
for($month = 1; $month<=12; $month++) {
$sql_projected = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_amount_for_month FROM invoices WHERE YEAR(invoice_due) = $year AND MONTH(invoice_due) = $month AND company_id = $session_company_id");
$sql_projected = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_amount_for_month FROM invoices WHERE YEAR(invoice_due) = $year AND MONTH(invoice_due) = $month AND invoice_status NOT LIKE 'Cancelled' AND invoice_status NOT LIKE 'Draft' AND company_id = $session_company_id");
$row = mysqli_fetch_array($sql_projected);
$invoice_for_month = $row['invoice_amount_for_month'];