30-Jan-2009 Joe Hunt
+ Outputs/Inputs on tax inquiry as well (why not)
-$ /gl/inquiry/tax_inquiry.php
-
+$ /gl/includes/db/gl_db_trans.inc
+ /gl/inquiry/tax_inquiry.php
+
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
$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_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, amount*ex_rate,0)) collectible,
+ 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,
+ IF(trans_type=0 || trans_type=2 || trans_type=10 || trans_type=11, 0, net_amount*ex_rate)) 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, 0, amount*ex_rate)) payable,
+ IF(trans_type=0 || trans_type=2 || trans_type=10 || trans_type=11, 0, amount*ex_rate)) collectible,
taxrec.rate,
ttype.id,
ttype.name
alt_table_row_color($k);
label_cell($tx['name'] . " " . $tx['rate'] . "%");
label_cell(_("Charged on sales") . " (" . _("Output Tax")."):");
- amount_cell($collectible);
- amount_cell($tx['net_input']);
+ amount_cell($payable);
+ amount_cell($tx['net_output']);
end_row();
alt_table_row_color($k);
label_cell($tx['name'] . " " . $tx['rate'] . "%");
label_cell(_("Paid on purchases") . " (" . _("Input Tax")."):");
- amount_cell($payable);
- amount_cell($tx['net_output']);
+ amount_cell($collectible);
+ amount_cell($tx['net_input']);
end_row();
alt_table_row_color($k);
label_cell("<b>".$tx['name'] . " " . $tx['rate'] . "%</b>");