summaryrefslogtreecommitdiff
path: root/httemplate/misc/process
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-07-31 23:02:14 -0700
committerIvan Kohler <ivan@freeside.biz>2012-07-31 23:02:14 -0700
commitf24c4bebce257bfcc61ba07fd3d16c5c0d730071 (patch)
treef6e908f55801cdfcb4db814f1365de12ef91e9bd /httemplate/misc/process
parent6cce5ada4fbf1e9ad7debd0451336e8005c12195 (diff)
invoice voiding, RT#18677
Diffstat (limited to 'httemplate/misc/process')
-rwxr-xr-xhttemplate/misc/process/void-cust_bill.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/httemplate/misc/process/void-cust_bill.html b/httemplate/misc/process/void-cust_bill.html
new file mode 100755
index 000000000..f2930ec01
--- /dev/null
+++ b/httemplate/misc/process/void-cust_bill.html
@@ -0,0 +1,22 @@
+%if ( $error ) {
+% $cgi->param('error', $error);
+<% $cgi->redirect(popurl(1). "void-cust_bill.html?". $cgi->query_string ) %>
+%} else {
+<% $cgi->redirect(popurl(3). "view/cust_main.cgi?". $custnum) %>
+%}
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Void invoices');
+
+#untaint invnum
+$cgi->param('invnum') =~ /^(\d+)$/ || die "Illegal invnum";
+my $invnum = $1;
+
+my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
+
+my $custnum = $cust_bill->custnum;
+
+my $error = $cust_bill->void( $cgi->param('reason') );
+
+</%init>