From ea3fd3b07585cbf1438ed587125e38051262819b Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 31 Oct 2017 09:57:56 +0100 Subject: [PATCH] Fixed Tax Report on Screen. --- gl/includes/db/gl_db_trans.inc | 8 ++++---- gl/inquiry/tax_inquiry.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gl/includes/db/gl_db_trans.inc b/gl/includes/db/gl_db_trans.inc index 4749b413..9234a0ad 100644 --- a/gl/includes/db/gl_db_trans.inc +++ b/gl/includes/db/gl_db_trans.inc @@ -513,15 +513,15 @@ function get_tax_summary($from, $to, $also_zero_purchases=false) $todate = date2sql($to); $sql = "SELECT - SUM(IF(trans_type=".ST_SUPPCREDIT.",-1,1)* + SUM(IF(trans_type=".ST_CUSTCREDIT.",-1,1)* IF((reg_type=".TR_OUTPUT.")" - ." || ((trans_type IN(".ST_SUPPINVOICE.",".ST_SUPPCREDIT.") OR (trans_type=".ST_JOURNAL." AND reg_type=".TR_INPUT.")) + ." || ((trans_type IN(".ST_SALESINVOICE.",".ST_CUSTCREDIT.") OR (trans_type=".ST_JOURNAL." AND reg_type=".TR_INPUT.")) ), net_amount*ex_rate,0) ) net_output, - SUM(IF(trans_type=".ST_SUPPCREDIT.",-1,1)* + SUM(IF(trans_type=".ST_CUSTCREDIT.",-1,1)* IF((reg_type=".TR_OUTPUT.")" - ." || ((trans_type IN(".ST_SUPPINVOICE.",".ST_SUPPCREDIT.") OR (trans_type=".ST_JOURNAL." AND reg_type=".TR_INPUT.")) + ." || ((trans_type IN(".ST_SALESINVOICE.",".ST_CUSTCREDIT.") OR (trans_type=".ST_JOURNAL." AND reg_type=".TR_INPUT.")) ), amount*ex_rate,0)) payable, SUM(IF(trans_type IN(".ST_SUPPCREDIT."),-1,1)* diff --git a/gl/inquiry/tax_inquiry.php b/gl/inquiry/tax_inquiry.php index d1a38637..3aae7939 100644 --- a/gl/inquiry/tax_inquiry.php +++ b/gl/inquiry/tax_inquiry.php @@ -88,7 +88,7 @@ function show_results() { $payable = $tx['payable']; - $collectible = $tx['collectible']; + $collectible = -$tx['collectible']; $net = $collectible + $payable; $total += $net; alt_table_row_color($k); @@ -101,7 +101,7 @@ function show_results() label_cell($tx['name'] . " " . $tx['rate'] . "%"); label_cell(_("Paid on purchases") . " (" . _("Input Tax")."):"); amount_cell($collectible); - amount_cell($tx['net_input']); + amount_cell(-$tx['net_input']); end_row(); alt_table_row_color($k); label_cell("".$tx['name'] . " " . $tx['rate'] . "%"); -- 2.30.2