A few minor fixes to get the tax report and inquiry right and syncronized
[fa-stable.git] / gl / includes / db / gl_db_trans.inc
index 8aaa76fb8e0281947b59ee698dc20acaa630937d..0e2d0b42a8b43ec92eb3116046af379c0eba9aa3 100644 (file)
@@ -287,13 +287,13 @@ function get_tax_summary($from, $to)
 
        $sql = "SELECT 
                                SUM(IF( trans_type=1 || trans_type=11 || trans_type=20,-1,1)*
-                               IF(trans_type=0 || trans_type=2 || trans_type=10 || trans_type=11, -net_amount*ex_rate,0)) net_input,
+                               IF(trans_type=0 || trans_type=2 || trans_type=10 || trans_type=11, net_amount*ex_rate,0)) net_input,
                                SUM(IF( trans_type=1 || trans_type=11 || trans_type=20,-1,1)*
-                               IF(trans_type=0 || trans_type=2 || trans_type=10 || trans_type=11, -amount*ex_rate,0)) payable,
+                               IF(trans_type=0 || trans_type=2 || trans_type=10 || trans_type=11, amount*ex_rate,0)) collectible,
                                SUM(IF( trans_type=1 || trans_type=11 || trans_type=20,-1,1)*
                                IF(trans_type=0 || trans_type=2 || trans_type=10 || trans_type=11, 0, net_amount*ex_rate)) net_output,
                                SUM(IF( trans_type=1 || trans_type=11 || trans_type=20,-1,1)*
-                               IF(trans_type=0 || trans_type=2 || trans_type=10 || trans_type=11, 0, amount*ex_rate)) collectible,
+                               IF(trans_type=0 || trans_type=2 || trans_type=10 || trans_type=11, 0, amount*ex_rate)) payable,
                                taxrec.rate,
                                ttype.id,
                                ttype.name