add bank branch to one-time payments, RT#14859
[freeside.git] / httemplate / misc / unapply-cust_pay.cgi
1 <% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %>
2 <%init>
3
4 die "access denied"
5   unless $FS::CurrentUser::CurrentUser->access_right('Unapply payment');
6
7 #untaint paynum
8 my($query) = $cgi->keywords;
9 $query =~ /^(\d+)$/ || die "Illegal paynum";
10 my $paynum = $1;
11
12 my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } );
13 my $custnum = $cust_pay->custnum;
14
15 foreach my $cust_bill_pay ( $cust_pay->cust_bill_pay ) {
16   my $error = $cust_bill_pay->delete;
17   errorpage($error) if $error;
18 }
19
20 </%init>