From 1ea1290793b5a6edd164906f1fc0ee1fc1e7d217 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Fri, 5 Feb 2016 15:16:12 -0600 Subject: RT#39586 Manual check refunds cannot be unapplied --- httemplate/misc/unapply-cust_credit_refund.cgi | 18 ++++++++++++++++++ httemplate/misc/unapply-cust_pay_refund.cgi | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 httemplate/misc/unapply-cust_credit_refund.cgi create mode 100755 httemplate/misc/unapply-cust_pay_refund.cgi (limited to 'httemplate/misc') diff --git a/httemplate/misc/unapply-cust_credit_refund.cgi b/httemplate/misc/unapply-cust_credit_refund.cgi new file mode 100755 index 000000000..55a81b055 --- /dev/null +++ b/httemplate/misc/unapply-cust_credit_refund.cgi @@ -0,0 +1,18 @@ +<% $cgi->redirect($p. "view/cust_main.cgi?custnum=". $custnum. ";show=payment_history") %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Unapply credit'); + +#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; + +my $error = $cust_credit->unapply_refund; +errorpage($error) if $error; + + diff --git a/httemplate/misc/unapply-cust_pay_refund.cgi b/httemplate/misc/unapply-cust_pay_refund.cgi new file mode 100755 index 000000000..9e470b6e4 --- /dev/null +++ b/httemplate/misc/unapply-cust_pay_refund.cgi @@ -0,0 +1,18 @@ +<% $cgi->redirect($p. "view/cust_main.cgi?custnum=". $custnum. ";show=payment_history") %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Unapply payment'); + +#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; + +my $error = $cust_pay->unapply_refund; +errorpage($error) if $error; + + -- cgit v1.2.1