From 5b20c0d8b91b5bc7c6cee549eff6c057aa210d44 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 19 Dec 2007 17:25:47 +0000 Subject: More batch enhancements git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1982 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/DBObject/Payment.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'LedgerSMB/DBObject') diff --git a/LedgerSMB/DBObject/Payment.pm b/LedgerSMB/DBObject/Payment.pm index f4382a28..b35bb2d8 100644 --- a/LedgerSMB/DBObject/Payment.pm +++ b/LedgerSMB/DBObject/Payment.pm @@ -366,14 +366,19 @@ sub get_payment_detail_data { if ($source_src) { $source_inc = $source_src; } else { - $source_inc = $0; + $source_inc = 0; } } + my $source_length = length($source_inc); + @{$self->{contact_invoices}} = $self->exec_method( funcname => 'payment_get_all_contact_invoices'); for my $inv (@{$self->{contact_invoices}}){ if (defined $self->{source_start}){ my $source = $self->{source_start}; + if (length($source_inc) < $source_length){ + $source_inc = sprintf('%0*s', $source_length, $source_inc); + } $source =~ s/$source_src(\D*)$/$source_inc$1/; ++ $source_inc; $inv->{source} = $source; -- cgit v1.2.3