Fixed Tax Report on Screen.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 31 Oct 2017 08:57:56 +0000 (09:57 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 31 Oct 2017 08:57:56 +0000 (09:57 +0100)
gl/includes/db/gl_db_trans.inc
gl/inquiry/tax_inquiry.php

index 4749b41354c7c8c277f8e5a679e4a9b3ae2eb6fe..9234a0ad827a7fe0cea4baea345d88f25438f93b 100644 (file)
@@ -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)*
index d1a38637d9eb26a77f0d35a74831dffa866e43d6..3aae793946984361d5e0799f667ecde2e517a840 100644 (file)
@@ -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("<b>".$tx['name'] . " " . $tx['rate'] . "%</b>");