From f24c4bebce257bfcc61ba07fd3d16c5c0d730071 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 31 Jul 2012 23:02:14 -0700 Subject: invoice voiding, RT#18677 --- httemplate/misc/process/void-cust_bill.html | 22 ++++++++++++++ httemplate/misc/void-cust_bill.html | 45 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100755 httemplate/misc/process/void-cust_bill.html create mode 100644 httemplate/misc/void-cust_bill.html (limited to 'httemplate/misc') 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') ); + + diff --git a/httemplate/misc/void-cust_bill.html b/httemplate/misc/void-cust_bill.html new file mode 100644 index 000000000..1608fd051 --- /dev/null +++ b/httemplate/misc/void-cust_bill.html @@ -0,0 +1,45 @@ +<& /elements/header-popup.html, mt('Void invoice') &> + +<% include('/elements/error.html') %> + +<% emt('Are you sure you want to void this invoice?') %> +

+ +<% emt("Invoice #[_1] ([_2])",$cust_bill->display_invnum, $money_char. $cust_bill->owed) %> +

+ +
+ + +<% ntable("#cccccc", 2) %> + + Reason + + + + + +
+
+   \ + +
+ +
+ + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Void invoices'); + +my $conf = new FS::Conf; +my $money_char = $conf->config('money_char') || '$'; + +#untaint invnum +$cgi->param('invnum') =~ /^(\d+)$/ || die "Illegal invnum"; +my $invnum = $1; + +my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); + + -- cgit v1.2.1