From 96637b65506feacf1698c874e4892d338ff2ecf8 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 13 Apr 2011 09:48:44 +0200 Subject: [PATCH] Suppress zero tax on printed documents. --- reporting/rep107.php | 2 ++ reporting/rep109.php | 9 ++++----- reporting/rep110.php | 2 ++ reporting/rep113.php | 2 ++ reporting/rep209.php | 7 +++---- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/reporting/rep107.php b/reporting/rep107.php index 3401320e..910b5b62 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -157,6 +157,8 @@ function print_invoices() $first = true; while ($tax_item = db_fetch($tax_items)) { + if ($tax_item['amount'] == 0) + continue; $DisplayTax = number_format2($sign*$tax_item['amount'], $dec); if (isset($suppress_tax_rates) && $suppress_tax_rates == 1) diff --git a/reporting/rep109.php b/reporting/rep109.php index 845d0ac7..25399a4b 100644 --- a/reporting/rep109.php +++ b/reporting/rep109.php @@ -166,12 +166,11 @@ function print_sales_orders() $first = true; foreach($tax_items as $tax_item) { + if ($tax_item['Value'] == 0) + continue; $DisplayTax = number_format2($tax_item['Value'], $dec); - if (isset($suppress_tax_rates) && $suppress_tax_rates == 1) - $tax_type_name = $tax_item['tax_type_name']; - else - $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) "; + $tax_type_name = $tax_item['tax_type_name']; if ($myrow['tax_included']) { @@ -188,7 +187,7 @@ function print_sales_orders() $first = false; } else - $rep->TextCol(3, 7, $doc_Included . " " . $tax_type_name . $doc_Amount . ": " . $DisplayTax, -2); + $rep->TextCol(3, 7, $doc_Included . " " . $tax_type_name . " " . $doc_Amount . ": " . $DisplayTax, -2); } else { diff --git a/reporting/rep110.php b/reporting/rep110.php index 6b392cd0..06857a8d 100644 --- a/reporting/rep110.php +++ b/reporting/rep110.php @@ -168,6 +168,8 @@ function print_deliveries() $first = true; while ($tax_item = db_fetch($tax_items)) { + if ($tax_item['amount'] == 0) + continue; $DisplayTax = number_format2($tax_item['amount'], $dec); if (isset($suppress_tax_rates) && $suppress_tax_rates == 1) diff --git a/reporting/rep113.php b/reporting/rep113.php index 3c140ea0..8e36f554 100644 --- a/reporting/rep113.php +++ b/reporting/rep113.php @@ -157,6 +157,8 @@ function print_credits() $first = true; while ($tax_item = db_fetch($tax_items)) { + if ($tax_item['amount'] == 0) + continue; $DisplayTax = number_format2($sign*$tax_item['amount'], $dec); if (isset($suppress_tax_rates) && $suppress_tax_rates == 1) diff --git a/reporting/rep209.php b/reporting/rep209.php index 1d297de5..e5094ebc 100644 --- a/reporting/rep209.php +++ b/reporting/rep209.php @@ -172,12 +172,11 @@ function print_po() $first = true; foreach($tax_items as $tax_item) { + if ($tax_item['Value'] == 0) + continue; $DisplayTax = number_format2($tax_item['Value'], $dec); - if (isset($suppress_tax_rates) && $suppress_tax_rates == 1) - $tax_type_name = $tax_item['tax_type_name']; - else - $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) "; + $tax_type_name = $tax_item['tax_type_name']; if ($myrow['tax_included']) { -- 2.30.2