diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-08 20:47:38 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-08 20:47:38 +0000 |
commit | 68399771603d9a2d084a9eaca480f17016801fe6 (patch) | |
tree | 02859ae3e2743f8b141a9837f703c21d77651759 /bin/mozilla/io.pl | |
parent | 7376ef357ac4dce6bf30548c773774dddd2ea033 (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-x | bin/mozilla/io.pl | 9 |
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; |