From 1115b9089e9d9ecf104bc61bb22e84f5233aa44b Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Tue, 9 Jun 2015 16:23:58 -0500 Subject: RT#33484: Delete lines from quick payment entry --- httemplate/misc/process/batch-cust_pay.cgi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'httemplate/misc/process/batch-cust_pay.cgi') 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"}, -- cgit v1.2.1 From e80770898cc86365b335845dd1a02b4d82bd7e40 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Mon, 13 Jul 2015 18:33:52 -0500 Subject: RT#31594: Unapplied payment issues --- httemplate/misc/process/batch-cust_pay.cgi | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/misc/process/batch-cust_pay.cgi') diff --git a/httemplate/misc/process/batch-cust_pay.cgi b/httemplate/misc/process/batch-cust_pay.cgi index bb4b9733c..ff7886239 100644 --- a/httemplate/misc/process/batch-cust_pay.cgi +++ b/httemplate/misc/process/batch-cust_pay.cgi @@ -40,6 +40,7 @@ foreach my $row ( map /^custnum(\d+)$/, keys %$param ) { 'payinfo' => $param->{"payinfo$row"}, 'discount_term' => $param->{"discount_term$row"}, 'paybatch' => $paybatch, + 'no_auto_apply' => exists($param->{"no_auto_apply$row"}) ? 'Y' : '', } if $param->{"custnum$row"} || $param->{"paid$row"} -- cgit v1.2.1