[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1043] branches/1.2/LedgerSMB/IS.pm



Revision: 1043
          http://svn.sourceforge.net/ledger-smb/?rev=1043&view=rev
Author:   einhverfr
Date:     2007-04-09 11:53:05 -0700 (Mon, 09 Apr 2007)

Log Message:
-----------
Fixing issue with sales tax not correctly posting for AR invoices  Still need to fix display issues

Modified Paths:
--------------
    branches/1.2/LedgerSMB/IS.pm

Modified: branches/1.2/LedgerSMB/IS.pm
===================================================================
--- branches/1.2/LedgerSMB/IS.pm	2007-04-09 15:56:05 UTC (rev 1042)
+++ branches/1.2/LedgerSMB/IS.pm	2007-04-09 18:53:05 UTC (rev 1043)
@@ -949,13 +949,12 @@
 			$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 @@
 			} else {
 				$tax += $amount = Tax::calculate_taxes(
 					..hidden.., $form, $linetotal, 0);
-
 				$fxtax += Tax::calculate_taxes(
 					..hidden.., $form, $linetotal, 0);
 			}
+			for (@taxaccounts) {
+				$form->{acc_trans}{$form->{id}}{$_->account}{amount} += $_->value;
+			}
 
 			$grossamount = $form->round_amount($linetotal, 2);
       
@@ -1122,7 +1123,6 @@
 	$invnetamount = $amount;
   
 	$amount = 0;
-
 	for (split / /, $form->{taxaccounts}) { 
 		$amount += 
 			$form->{acc_trans}{$form->{id}}{$_}{amount} = 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.