quick pay shouldnt default to exact search
[freeside.git] / httemplate / misc / unapply-cust_credit.cgi
1 <%
2
3 #untaint crednum
4 my($query) = $cgi->keywords;
5 $query =~ /^(\d+)$/ || die "Illegal crednum";
6 my $crednum = $1;
7
8 my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } );
9 my $custnum = $cust_credit->custnum;
10
11 foreach my $cust_credit_bill ( $cust_credit->cust_credit_bill ) {
12   my $error = $cust_credit_bill->delete;
13   eidiot($error) if $error;
14 }
15
16 print $cgi->redirect($p. "view/cust_main.cgi?". $custnum);
17
18 %>