summaryrefslogtreecommitdiff
path: root/httemplate/misc/process/batch-cust_pay.cgi
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-06-09 16:23:58 -0500
committerJonathan Prykop <jonathan@freeside.biz>2015-06-09 16:23:58 -0500
commitbda35ac2da6481a1e4f5414c0b7caf2b90d26fcf (patch)
treee8487a504370449984ddf440bebf014f3c868026 /httemplate/misc/process/batch-cust_pay.cgi
parent536c3720cb3820d7806d2e672463b5b3d06be078 (diff)
RT#33484: Delete lines from quick payment entry
Diffstat (limited to 'httemplate/misc/process/batch-cust_pay.cgi')
-rw-r--r--httemplate/misc/process/batch-cust_pay.cgi6
1 files changed, 4 insertions, 2 deletions
diff --git a/httemplate/misc/process/batch-cust_pay.cgi b/httemplate/misc/process/batch-cust_pay.cgi
index 1105af943..bb4b9733c 100644
--- a/httemplate/misc/process/batch-cust_pay.cgi
+++ b/httemplate/misc/process/batch-cust_pay.cgi
@@ -12,7 +12,8 @@ my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
my @cust_pay = ();
#my $row = 0;
#while ( exists($param->{"custnum$row"}) ) {
-for ( my $row = 0; exists($param->{"custnum$row"}); $row++ ) {
+my @invrows = grep(/^invnum\d+\.\d+$/, keys %$param);
+foreach my $row ( map /^custnum(\d+)$/, keys %$param ) {
my $custnum = $param->{"custnum$row"};
my $cust_main;
if ( $custnum =~ /^(\d+)$/ and $1 <= 2147483647 ) {
@@ -48,7 +49,8 @@ for ( my $row = 0; exists($param->{"custnum$row"}); $row++ ) {
# payment applications, if any
my @cust_bill_pay = ();
- for ( my $app = 0; exists($param->{"invnum$row.$app"}); $app++ ) {
+ foreach my $app ( sort {$a <=> $b} map /^invnum$row\.(\d+)$/, @invrows ) {
+# for ( my $app = 0; exists($param->{"invnum$row.$app"}); $app++ ) {
next if !$param->{"invnum$row.$app"};
push @cust_bill_pay, new FS::cust_bill_pay {
'invnum' => $param->{"invnum$row.$app"},