Sign fix on tax calculation
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 29 Jan 2009 21:01:47 +0000 (21:01 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 29 Jan 2009 21:01:47 +0000 (21:01 +0000)
gl/includes/db/gl_db_trans.inc

index d8e6d58a269b8fa7e6858aa282a1936ab321b7ad..8aaa76fb8e0281947b59ee698dc20acaa630937d 100644 (file)
@@ -287,9 +287,9 @@ 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)) payable,
                                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)*