From 5f87c41f16ab2c9da14f85f1b2d7e7b771059c10 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 9 Apr 2007 18:53:05 +0000 Subject: 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 --- LedgerSMB/IS.pm | 12 ++++++------ 1 file 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} = -- cgit v1.2.3