From ecd7a1cdcae16f2f59c9c75cac8aeec2e3c3d7a1 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Oct 2002 15:49:36 +0000 Subject: add option to unapply payments --- httemplate/misc/unapply-cust_pay.cgi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 httemplate/misc/unapply-cust_pay.cgi (limited to 'httemplate/misc') diff --git a/httemplate/misc/unapply-cust_pay.cgi b/httemplate/misc/unapply-cust_pay.cgi new file mode 100755 index 000000000..28643ef6e --- /dev/null +++ b/httemplate/misc/unapply-cust_pay.cgi @@ -0,0 +1,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); + +%> -- cgit v1.2.1