summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-08-25 23:54:38 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-08-25 23:54:38 +0000
commit7e253963da955750b76c06278fcb9ba6a7ec5ccd (patch)
treec7ab4f37869aa843f387d82a88202c206314860b
parent52643ace1a274b514165d640860956f089be251a (diff)
Correcting double free bug on Perl 5.10.0
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@2303 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/IS.pm14
1 files changed, 6 insertions, 8 deletions
diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm
index b577f72c..910bceb7 100755
--- a/LedgerSMB/IS.pm
+++ b/LedgerSMB/IS.pm
@@ -36,10 +36,10 @@ use LedgerSMB::Tax;
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 @@ sub invoice_details {
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 @@ sub invoice_details {
Tax::calculate_taxes( \@taxaccounts, $form, $linetotal, 0 );
$tax += Tax::apply_taxes( \@taxaccounts, $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;
}
}