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

SF.net SVN: ledger-smb: [1094] branches/1.2/LedgerSMB



Revision: 1094
          http://svn.sourceforge.net/ledger-smb/?rev=1094&view=rev
Author:   tetragon
Date:     2007-04-21 18:38:46 -0700 (Sat, 21 Apr 2007)

Log Message:
-----------
Fix for NaN.00 invoice prints and regex tweaks to init_taxes

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

Modified: branches/1.2/LedgerSMB/IS.pm
===================================================================
--- branches/1.2/LedgerSMB/IS.pm	2007-04-18 18:34:30 UTC (rev 1093)
+++ branches/1.2/LedgerSMB/IS.pm	2007-04-22 01:38:46 UTC (rev 1094)
@@ -333,7 +333,6 @@
               ? $form->format_amount( $myconfig, $discount * -1,
                 $decimalplaces )
               : " ";
-            $linetotal = ($linetotal) ? $linetotal : " ";
 
             push( @{ $form->{discount} }, $discount );
             push(
@@ -348,6 +347,7 @@
 
             $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 @@
         $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;
 

Modified: branches/1.2/LedgerSMB/Tax.pm
===================================================================
--- branches/1.2/LedgerSMB/Tax.pm	2007-04-18 18:34:30 UTC (rev 1093)
+++ branches/1.2/LedgerSMB/Tax.pm	2007-04-22 01:38:46 UTC (rev 1094)
@@ -36,9 +36,9 @@
     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 @@
     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;


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