From e433c819a8fab88a235cc2a5eda27b9ef564a104 Mon Sep 17 00:00:00 2001 From: wrongecho Date: Thu, 3 Oct 2024 20:41:12 +0100 Subject: [PATCH 1/3] Tidy up the tax report --- report_tax_summary.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/report_tax_summary.php b/report_tax_summary.php index 90775c6b..fd180ecf 100644 --- a/report_tax_summary.php +++ b/report_tax_summary.php @@ -71,23 +71,24 @@ $sql_tax = mysqli_query($mysqli, "SELECT `tax_name` FROM `taxes`"); "; echo "" . $row['tax_name'] . ""; if ($view == 'monthly') { for ($i = 1; $i <= 12; $i++) { - $monthly_tax = getMonthlyTax($row['tax_name'], $i, $year, $mysqli); + $monthly_tax = getMonthlyTax($tax_name, $i, $year, $mysqli); echo "" . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . ""; } } else { for ($q = 1; $q <= 4; $q++) { - $quarterly_tax = getQuarterlyTax($row['tax_name'], $q, $year, $mysqli); + $quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli); echo "" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . ""; } } // Calculate total for row and echo bold - $total_tax = getTotalTax($row['tax_name'], $year, $mysqli); + $total_tax = getTotalTax($tax_name, $year, $mysqli); echo "" . numfmt_format_currency($currency_format, $total_tax, $company_currency) . ""; echo ""; } @@ -97,12 +98,12 @@ $sql_tax = mysqli_query($mysqli, "SELECT `tax_name` FROM `taxes`"); " . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . ""; } } else { for ($q = 1; $q <= 4; $q++) { - $quarterly_tax = getQuarterlyTax($row['tax_name'], $q, $year, $mysqli); + $quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli); echo "" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . ""; } } From 5635cd9b8c929f6364fe7b3a33feee1e7e9cd13d Mon Sep 17 00:00:00 2001 From: wrongecho Date: Thu, 3 Oct 2024 20:41:28 +0100 Subject: [PATCH 2/3] Tidy up the tax report --- report_tax_summary.php | 74 +++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/report_tax_summary.php b/report_tax_summary.php index fd180ecf..c99264c7 100644 --- a/report_tax_summary.php +++ b/report_tax_summary.php @@ -69,48 +69,48 @@ $sql_tax = mysqli_query($mysqli, "SELECT `tax_name` FROM `taxes`"); - "; - echo "" . $row['tax_name'] . ""; + "; + echo "" . $row['tax_name'] . ""; - if ($view == 'monthly') { - for ($i = 1; $i <= 12; $i++) { - $monthly_tax = getMonthlyTax($tax_name, $i, $year, $mysqli); - echo "" . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . ""; - } - } else { - for ($q = 1; $q <= 4; $q++) { - $quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli); - echo "" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . ""; - } + if ($view == 'monthly') { + for ($i = 1; $i <= 12; $i++) { + $monthly_tax = getMonthlyTax($tax_name, $i, $year, $mysqli); + echo "" . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . ""; } + } else { + for ($q = 1; $q <= 4; $q++) { + $quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli); + echo "" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . ""; + } + } - // Calculate total for row and echo bold - $total_tax = getTotalTax($tax_name, $year, $mysqli); - echo "" . numfmt_format_currency($currency_format, $total_tax, $company_currency) . ""; - echo ""; + // Calculate total for row and echo bold + $total_tax = getTotalTax($tax_name, $year, $mysqli); + echo "" . numfmt_format_currency($currency_format, $total_tax, $company_currency) . ""; + echo ""; + } + ?> + + Total + " . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . ""; + } + } else { + for ($q = 1; $q <= 4; $q++) { + $quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli); + echo "" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . ""; + } } ?> - - Total - " . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . ""; - } - } else { - for ($q = 1; $q <= 4; $q++) { - $quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli); - echo "" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . ""; - } - } - ?> - - - + + + From 90fb28e32b0a231b04fb055fd0adcc5eb01da5f6 Mon Sep 17 00:00:00 2001 From: wrongecho Date: Thu, 3 Oct 2024 20:42:56 +0100 Subject: [PATCH 3/3] Tidy up the tax report + perms --- report_tax_summary.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report_tax_summary.php b/report_tax_summary.php index c99264c7..73d92467 100644 --- a/report_tax_summary.php +++ b/report_tax_summary.php @@ -2,7 +2,7 @@ require_once "inc_all_reports.php"; -validateAccountantRole(); +enforceUserPermission('module_financial'); $year = isset($_GET['year']) ? intval($_GET['year']) : date('Y');