summaryrefslogtreecommitdiff
path: root/httemplate/misc/process/payment.cgi
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-08-08 19:35:34 -0400
committerChristopher Burger <burgerc@freeside.biz>2018-08-10 06:38:44 -0400
commitbcbc2580692528ee67b85f3d33f267a59ee530c8 (patch)
tree9cdfa8ac2aada8ac740eb3327e61792d8d0db65b /httemplate/misc/process/payment.cgi
parent9dfb97b6fb41274ac7990f092365657cb98fa007 (diff)
RT# 34134 - updated select invoice to actually pay the invoice being selected not the oldest one.
Diffstat (limited to 'httemplate/misc/process/payment.cgi')
-rw-r--r--httemplate/misc/process/payment.cgi4
1 files changed, 4 insertions, 0 deletions
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index 5620b5b4b..939fc38c2 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -39,6 +39,8 @@ my $cust_main = qsearchs({
'extra_sql' => ' AND '. $curuser->agentnums_sql,
}) or die "unknown custnum $custnum";
+my $invoice = ($cgi->param('invoice') =~ /^(\d+)$/) ? $cgi->param('invoice') : '';
+
$cgi->param('amount') =~ /^\s*(\d*(\.\d\d)?)\s*$/
or errorpage("illegal amount ". $cgi->param('amount'));
my $amount = $1;
@@ -224,6 +226,7 @@ if ( $cgi->param('batch') ) {
'payinfo' => $payinfo,
'paydate' => $paydate,
'payname' => $payname,
+ 'invnum' => $invoice,
map { $_ => scalar($cgi->param($_)) }
@{$payby2fields{$payby}}
);
@@ -246,6 +249,7 @@ if ( $cgi->param('batch') ) {
'discount_term' => $discount_term,
'no_auto_apply' => ($cgi->param('apply') eq 'never') ? 'Y' : '',
'no_invnum' => 1,
+ 'invnum' => $invoice,
map { $_ => scalar($cgi->param($_)) } @{$payby2fields{$payby}}
);
errorpage($error) if $error;