summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-09 18:53:05 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-09 18:53:05 +0000
commit5f87c41f16ab2c9da14f85f1b2d7e7b771059c10 (patch)
tree6423e67897869a87c0a4511f799a477d23bbc10b
parent4a107c396ea720919e9fe3ebb5cb63d183abad86 (diff)
Fixing issue with sales tax not correctly posting for AR invoices Still need to fix display issues
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1043 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/IS.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm
index 5ed3996d..c1594338 100755
--- a/LedgerSMB/IS.pm
+++ b/LedgerSMB/IS.pm
@@ -949,13 +949,12 @@ sub post_invoice {
$amount = $fxlinetotal * $form->{exchangerate};
my $linetotal = $form->round_amount($amount, 2);
$fxdiff += $amount - $linetotal;
-
@taxaccounts = Tax::init_taxes(
$form, $form->{"taxaccounts_$i"});
$ml = 1;
- $tax = 0;
- $fxtax = 0;
-
+ $tax = Math::BigFloat->bzero();
+ $fxtax = Math::BigFloat->bzero();
+
if ($form->{taxincluded}) {
$tax += $amount =
Tax::calculate_taxes(
@@ -969,10 +968,12 @@ sub post_invoice {
} else {
$tax += $amount = Tax::calculate_taxes(
\@taxaccounts, $form, $linetotal, 0);
-
$fxtax += Tax::calculate_taxes(
\@taxaccounts, $form, $linetotal, 0);
}
+ for (@taxaccounts) {
+ $form->{acc_trans}{$form->{id}}{$_->account}{amount} += $_->value;
+ }
$grossamount = $form->round_amount($linetotal, 2);
@@ -1122,7 +1123,6 @@ sub post_invoice {
$invnetamount = $amount;
$amount = 0;
-
for (split / /, $form->{taxaccounts}) {
$amount +=
$form->{acc_trans}{$form->{id}}{$_}{amount} =