summaryrefslogtreecommitdiff
path: root/bin/mozilla/io.pl
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-08 20:47:38 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-08 20:47:38 +0000
commit68399771603d9a2d084a9eaca480f17016801fe6 (patch)
tree02859ae3e2743f8b141a9837f703c21d77651759 /bin/mozilla/io.pl
parent7376ef357ac4dce6bf30548c773774dddd2ea033 (diff)
First round of tax code replacement, adds cumulative tax support
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@195 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'bin/mozilla/io.pl')
-rwxr-xr-xbin/mozilla/io.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl
index d81fa34c..b2ea21b2 100755
--- a/bin/mozilla/io.pl
+++ b/bin/mozilla/io.pl
@@ -38,6 +38,8 @@
#
#######################################################################
+use LedgerSMB::Tax;
+
# any custom scripts for this one
if (-f "$form->{path}/custom_io.pl") {
eval { require "$form->{path}/custom_io.pl"; };
@@ -504,7 +506,8 @@ sub item_selected {
$amount = $form->{"sellprice_$i"} * (1 - $form->{"discount_$i"} / 100) * $form->{"qty_$i"};
for (split / /, $form->{"taxaccounts_$i"}) { $form->{"${_}_base"} += $amount }
if (!$form->{taxincluded}) {
- for (split / /, $form->{"taxaccounts_$i"}) { $amount += ($form->{"${_}_base"} * $form->{"${_}_rate"}) }
+ my @taxlist= Tax::init_taxes($form, $form->{"taxaccounts_$i"});
+ $amount += Tax::calculate_taxes(\@taxlist, $form, $amount, 0);
}
$form->{creditremaining} -= $amount;
@@ -840,7 +843,9 @@ sub invoicetotal {
}
if (!$form->{taxincluded}) {
- for (split / /, $form->{taxaccounts}) { $form->{oldinvtotal} += ($form->{"${_}_base"} * $form->{"${_}_rate"}) }
+ my @taxlist= Tax::init_taxes($form, $form->{taxaccounts});
+ $form->{oldinvtotal} += Tax::calculate_taxes(\@taxlist, $form,
+ $amount, 0);
}
$form->{oldtotalpaid} = 0;