summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-22 01:38:46 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-22 01:38:46 +0000
commitebc3a8f35b6f04686f125760b44f38e81043fe9a (patch)
tree19bc052371041ac9816ec583affc89b04f45f296
parent911f279b80094f075f825f3753f09a5722a57032 (diff)
Fix for NaN.00 invoice prints and regex tweaks to init_taxes
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1094 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/IS.pm3
-rwxr-xr-xLedgerSMB/Tax.pm6
2 files changed, 5 insertions, 4 deletions
diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm
index ba87f0c6..7e6ed8a2 100755
--- a/LedgerSMB/IS.pm
+++ b/LedgerSMB/IS.pm
@@ -333,7 +333,6 @@ sub invoice_details {
? $form->format_amount( $myconfig, $discount * -1,
$decimalplaces )
: " ";
- $linetotal = ($linetotal) ? $linetotal : " ";
push( @{ $form->{discount} }, $discount );
push(
@@ -348,6 +347,7 @@ sub invoice_details {
$form->{"linetotal_$i"} =
$form->format_amount( $myconfig, $linetotal, 2 );
+ $form->{"linetotal_$i"} = '0.00' unless $form->{"linetotal_$i"};
push( @{ $form->{linetotal} }, $form->{"linetotal_$i"} );
@@ -602,6 +602,7 @@ sub invoice_details {
$form->{$_} = $form->format_amount( $myconfig, $form->{$_} );
}
$form->{subtotal} = $form->format_amount( $myconfig, $form->{total}, 2 );
+ $form->{subtotal} = '0.00' unless $form->{subtotal};
$form->{invtotal} =
( $form->{taxincluded} ) ? $form->{total} : $form->{total} + $tax;
diff --git a/LedgerSMB/Tax.pm b/LedgerSMB/Tax.pm
index 70161257..01bff4d4 100755
--- a/LedgerSMB/Tax.pm
+++ b/LedgerSMB/Tax.pm
@@ -36,9 +36,9 @@ sub init_taxes {
my @accounts = split / /, $taxaccounts;
if ( defined $taxaccounts2 ) {
my @tmpaccounts = @accounts;
- $#accounts = 0;
+ $#accounts = -1;
for my $acct ( split / /, $taxaccounts2 ) {
- if ( $taxaccounts =~ /\s$acct\s/ ) {
+ if ( $taxaccounts =~ /\b$acct\b/ ) {
push @accounts, $acct;
}
}
@@ -53,7 +53,7 @@ sub init_taxes {
foreach $taxaccount (@accounts) {
next if ( !defined $taxaccount );
if ( defined $taxaccounts2 ) {
- next if $taxaccount !~ /$taxaccounts2/;
+ next if $taxaccounts2 !~ /\b$taxaccount\b/;
}
$sth->execute($taxaccount) || $form->dberror($query);
my $ref = $sth->fetchrow_hashref;