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

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



Revision: 2303
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2303&view=rev
Author:   einhverfr
Date:     2008-08-25 23:54:38 +0000 (Mon, 25 Aug 2008)

Log Message:
-----------
Correcting double free bug on Perl 5.10.0

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

Modified: branches/1.2/LedgerSMB/IS.pm
===================================================================
--- branches/1.2/LedgerSMB/IS.pm	2008-08-25 23:52:52 UTC (rev 2302)
+++ branches/1.2/LedgerSMB/IS.pm	2008-08-25 23:54:38 UTC (rev 2303)
@@ -36,10 +36,10 @@
 use LedgerSMB::PriceMatrix;
 use LedgerSMB::Sysconfig;
 
+
 sub invoice_details {
     use LedgerSMB::CP;
     my ( $self, $myconfig, $form ) = @_;
-
     $form->{duedate} = $form->{transdate} unless ( $form->{duedate} );
 
     # connect to database
@@ -53,7 +53,6 @@
     my $sth = $dbh->prepare($query);
     $sth->execute( $form->{duedate}, $form->{transdate} )
       || $form->dberror($query);
-
     ( $form->{terms}, $form->{weightunit} ) = $sth->fetchrow_array;
     $sth->finish;
 
@@ -376,15 +375,14 @@
                   Tax::calculate_taxes( ..hidden.., $form, $linetotal, 0 );
                 $tax += Tax::apply_taxes( ..hidden.., $form, $linetotal );
             }
-
-            foreach $item (@taxaccounts) {
-                push @taxrates, 100 * $item->rate;
-                $taxaccounts{ $item->account } += $item->value;
+            for my $taxitem (@taxaccounts) {
+                push @taxrates, 100 * $taxitem->rate;
+                $taxaccounts{ $taxitem->account } += $taxitem->value;
                 if ( $form->{taxincluded} ) {
-                    $taxbase{ $item->account } += $taxbase;
+                    $taxbase{ $taxitem->account } += $taxbase;
                 }
                 else {
-                    $taxbase{ $item->account } += $linetotal;
+                    $taxbase{ $taxitem->account } += $linetotal;
                 }
             }
 


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