diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-08-01 14:01:14 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-08-01 14:01:14 -0700 |
commit | bec3b6c2bf97d66b992866d7ee7295f1f05452e6 (patch) | |
tree | 78fb0c2523f237ad06905fe099dc5d32330a0e6e /httemplate/misc/unvoid-cust_bill_void.html | |
parent | 55675d6cdd93f00b7c0ac93403e8c4d66567a729 (diff) |
invoice voiding, RT#18677
Diffstat (limited to 'httemplate/misc/unvoid-cust_bill_void.html')
-rwxr-xr-x | httemplate/misc/unvoid-cust_bill_void.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/httemplate/misc/unvoid-cust_bill_void.html b/httemplate/misc/unvoid-cust_bill_void.html new file mode 100755 index 000000000..f61416549 --- /dev/null +++ b/httemplate/misc/unvoid-cust_bill_void.html @@ -0,0 +1,25 @@ +%if ( $error ) { +% errorpage($error); +%} else { +% my $show = $curuser->default_customer_view =~ /^(jumbo|payment_history)$/ +% ? '' +% : ';show=payment_history'; +<% $cgi->redirect($p. "view/cust_main.cgi?custnum=$custnum$show" ) %> +%} +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('Unvoid invoices'); + +#untaint invnum +$cgi->param('invnum') =~ /^(\d+)$/ || die "Illegal invnum"; +my $invnum = $1; + +my $cust_bill_void = qsearchs('cust_bill_void', { 'invnum' => $invnum } ); +my $custnum = $cust_bill_void->custnum; + +my $error = $cust_bill_void->unvoid; + +</%init> |