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

SF.net SVN: ledger-smb:[2413] trunk/scripts/payment.pl



Revision: 2413
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2413&view=rev
Author:   einhverfr
Date:     2008-11-21 22:02:08 +0000 (Fri, 21 Nov 2008)

Log Message:
-----------
Correcting serious issue with check printing

Modified Paths:
--------------
    trunk/scripts/payment.pl

Modified: trunk/scripts/payment.pl
===================================================================
--- trunk/scripts/payment.pl	2008-11-21 20:45:17 UTC (rev 2412)
+++ trunk/scripts/payment.pl	2008-11-21 22:02:08 UTC (rev 2413)
@@ -305,7 +305,7 @@
                 $inv_count = $LedgerSMB::Sysconfig::check_max_invoices;
             }
 
-            for my $inv (1 .. $inv_count){
+            for my $inv (1 .. $payment->{"invoice_count_$id"}){
                 my $invhash = {};
                 my $inv_id = $payment->{"invoice_${id}_$inv"};
                 for (qw(invnumber invdate)){
@@ -320,7 +320,7 @@
                 }
                 $check->{amount} += $invhash->{paid};
                 $invhash->{paid} = $check->format_amount(amount => $invhash->{paid});
-                push @{$check->{invoices}}, $invhash;
+                push @{$check->{invoices}}, $invhash if $inv <= $inv_count;
             }
             my $amt = $check->{amount}->copy;
             $amt->bfloor();


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