From 92fa788fb842baab8fa185e159d8effde739bd74 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 12 Mar 2004 12:39:57 +0000 Subject: add unapplycredits configuration option --- httemplate/misc/unapply-cust_credit.cgi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 httemplate/misc/unapply-cust_credit.cgi (limited to 'httemplate/misc') diff --git a/httemplate/misc/unapply-cust_credit.cgi b/httemplate/misc/unapply-cust_credit.cgi new file mode 100755 index 000000000..c658d2acc --- /dev/null +++ b/httemplate/misc/unapply-cust_credit.cgi @@ -0,0 +1,18 @@ +<% + +#untaint crednum +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/ || die "Illegal crednum"; +my $crednum = $1; + +my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); +my $custnum = $cust_credit->custnum; + +foreach my $cust_credit_bill ( $cust_credit->cust_credit_bill ) { + my $error = $cust_credit_bill->delete; + eidiot($error) if $error; +} + +print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); + +%> -- cgit v1.2.1