3 $cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
6 my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } )
7 or die "No such paynum";
9 my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pay->custnum } )
10 or die "Bogus credit: not attached to customer";
12 my $custnum = $cust_main->custnum;
14 my $new = new FS::cust_bill_pay ( {
16 $_, scalar($cgi->param($_));
17 #} qw(custnum _date amount invnum)
18 } fields('cust_bill_pay')
21 my $error = $new->insert;
24 $cgi->param('error', $error);
25 print $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string );
27 print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");