! -> Note
$ -> Affected files
+29-Jan-2009 Joe Hunt
+# A few minor fixes to get the tax report and inquiry right and syncronized
+$ /gl/includes/db/gl_db_trans.inc
+ /gl/inquiry/tax_inquiry.php
+ /reporting/rep709.php
+# Missing parameter to add_trans_tax_details
+$ /sales/includes/db/sales_credit_db.inc
+ /sales/includes/db/sales_delivery_db.inc
+ /sales/includes/db/sales_invoice_db.inc
+
29-Jan-2009 Janusz Dobrowolski
# Changes related to rewrite and optimalization of tax registration
$ /gl/includes/db/gl_db_bank_trans.inc
$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
$payable = $tx['payable'];
$collectible = $tx['collectible'];
- $net = $collectible - $payable;
+ $net = $collectible + $payable;
$total += $net;
alt_table_row_color($k);
label_cell($tx['name'] . " " . $tx['rate'] . "%");
$taxes[$trans['tax_type_id']]['taxout'] += $trans['amount'];
$taxes[$trans['tax_type_id']]['out'] += $trans['net_amount'];
} else {
- $taxes[$trans['tax_type_id']]['taxin'] -= $trans['amount'];
- $taxes[$trans['tax_type_id']]['in'] -= $trans['net_amount'];
+ $taxes[$trans['tax_type_id']]['taxin'] += $trans['amount'];
+ $taxes[$trans['tax_type_id']]['in'] += $trans['net_amount'];
}
-
$totalnet += $trans['net_amount'];
$totaltax += $trans['amount'];
}
$rep->TextCol(2, 3,number_format2($sum['taxout'], $dec));
$rep->TextCol(3, 4, number_format2($sum['in'], $dec));
$rep->TextCol(4, 5,number_format2($sum['taxin'], $dec));
- $rep->TextCol(5, 6, number_format2($sum['taxout']-$sum['taxin'], $dec));
- $taxtotal += $sum['taxout']-$sum['taxin'];
+ $rep->TextCol(5, 6, number_format2($sum['taxout']+$sum['taxin'], $dec));
+ $taxtotal += $sum['taxout']+$sum['taxin'];
$rep->NewLine();
}