From 92a68cf926d04cf42cb83cf6cbaba0d53e5a3a1b Mon Sep 17 00:00:00 2001 From: "johnny@pittpc.com" Date: Tue, 17 Sep 2019 14:16:29 -0400 Subject: [PATCH] Reverted last change and applied the fix to Expense by Category in dashboard which was showing transfers as expenses which was incorrect --- dashboard.php | 98 +++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/dashboard.php b/dashboard.php index 44904c11..84573e9b 100644 --- a/dashboard.php +++ b/dashboard.php @@ -458,7 +458,7 @@ var myPieChart = new Chart(ctx, { data: { labels: [ 0 AND YEAR(expense_date) = $year AND categories.company_id = $session_company_id"); while($row = mysqli_fetch_array($sql_categories)){ $category_name = $row['category_name']; echo "\"$category_name\","; @@ -470,7 +470,7 @@ var myPieChart = new Chart(ctx, { datasets: [{ data: [ 0 AND YEAR(expense_date) = $year AND categories.company_id = $session_company_id"); while($row = mysqli_fetch_array($sql_categories)){ $category_id = $row['category_id']; @@ -482,53 +482,6 @@ var myPieChart = new Chart(ctx, { ?> - ], - backgroundColor: [ - - - ], - }], - }, -}); - -// Pie Chart Example -var ctx = document.getElementById("expenseByVendorPieChart"); -var myPieChart = new Chart(ctx, { - type: 'pie', - data: { - labels: [ - 0 AND YEAR(expense_date) = $year AND vendors.company_id = $session_company_id"); - while($row = mysqli_fetch_array($sql_vendors)){ - $vendor_name = $row['vendor_name']; - echo "\"$vendor_name\","; - } - - ?> - - ], - datasets: [{ - data: [ - 0 AND YEAR(expense_date) = $year AND vendors.company_id = $session_company_id"); - while($row = mysqli_fetch_array($sql_vendors)){ - $vendor_id = $row['vendor_id']; - - $sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_amount_for_year FROM expenses WHERE vendor_id = $vendor_id AND YEAR(expense_date) = $year"); - $row = mysqli_fetch_array($sql_expenses); - $expense_amount_for_year = $row['expense_amount_for_year']; - echo "$expense_amount_for_year,"; - } - - ?> - ], backgroundColor: [ + + ], + datasets: [{ + data: [ + + + ], + backgroundColor: [ + + + ], + }], + }, +}); + \ No newline at end of file