From 3a02e398ce013116c6ee97fc18472a6f40e0798d Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 4 Oct 2009 02:09:14 +0000 Subject: delete invoices, RT#4048 --- httemplate/view/cust_bill.cgi | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'httemplate/view/cust_bill.cgi') diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 2673e8239..5540221d9 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -2,10 +2,31 @@ "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum", )) %> +% if ( $conf->exists('deleteinvoices') +% && $curuser->access_right('Delete invoices' ) +% ) +% { + + + + Delete this invoice +

+ +% } % if ( $cust_bill->owed > 0 % && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) ) -% && $FS::CurrentUser::CurrentUser->access_right('Post payment') +% && $curuser->access_right('Post payment') % && ! $conf->exists('pkg-balances') % ) % { @@ -37,8 +58,7 @@ % } - -% if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { +% if ( $curuser->access_right('Resend invoices') ) { Re-print this invoice @@ -54,10 +74,9 @@ % } - % if ( $conf->exists('invoice_latex') ) { - View typeset invoice + View typeset invoice PDF

% } @@ -83,8 +102,10 @@ <% include('/elements/footer.html') %> <%init> +my $curuser = $FS::CurrentUser::CurrentUser; + die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); + unless $curuser->access_right('View invoices'); #untaint invnum my($query) = $cgi->keywords; @@ -105,7 +126,7 @@ my $cust_bill = qsearchs({ 'table' => 'cust_bill', 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', 'hashref' => { 'invnum' => $invnum }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, }); die "Invoice #$invnum not found!" unless $cust_bill; @@ -117,5 +138,3 @@ my $display_custnum = $cust_bill->cust_main->display_custnum; my $link = $templatename ? "$templatename-$invnum" : $invnum; - - -- cgit v1.2.1