summaryrefslogtreecommitdiff
path: root/httemplate/misc/unapply-cust_pay.cgi
blob: 28643ef6e6e9564006db377d87098779bb61cf9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<%

#untaint paynum
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/ || die "Illegal paynum";
my $paynum = $1;

my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } );
my $custnum = $cust_pay->custnum;

foreach my $cust_bill_pay ( $cust_pay->cust_bill_pay ) {
  my $error = $cust_bill_pay->delete;
  eidiot($error) if $error;
}

print $cgi->redirect($p. "view/cust_main.cgi?". $custnum);

%>