summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authorivan <ivan>2004-03-12 12:39:57 +0000
committerivan <ivan>2004-03-12 12:39:57 +0000
commit92fa788fb842baab8fa185e159d8effde739bd74 (patch)
treee2329d5ac7f169c053b8975398c793a7444f7fd1 /httemplate/misc
parentc13536bec93ca007d6b339dfbc7edc81ae58c082 (diff)
add unapplycredits configuration option
Diffstat (limited to 'httemplate/misc')
-rwxr-xr-xhttemplate/misc/unapply-cust_credit.cgi18
1 files changed, 18 insertions, 0 deletions
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);
+
+%>