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_main/payment_history.html | 2 +- .../view/cust_main/payment_history/invoice.html | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'httemplate/view/cust_main') diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 0050daf9d..2ac3f2633 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -379,7 +379,7 @@ my %opt = ( qw( card_refund-days ) ), ( map { $_ => $conf->exists($_) } - qw( deletepayments deleterefunds pkg-balances ) + qw( deleteinvoices deletepayments deleterefunds pkg-balances ) ) ); diff --git a/httemplate/view/cust_main/payment_history/invoice.html b/httemplate/view/cust_main/payment_history/invoice.html index 39c67396e..c0d32df4d 100644 --- a/httemplate/view/cust_main/payment_history/invoice.html +++ b/httemplate/view/cust_main/payment_history/invoice.html @@ -1,9 +1,11 @@ -<% $link %><% $pre %>Invoice #<% $invnum %> -(Balance $ <% $cust_bill->owed %>)<% $post %><% $link ? '' : '' %><% $events %> +<% $link %><% $pre %>Invoice #<% $cust_bill->display_invnum %> +(Balance $ <% $cust_bill->owed %>)<% $post %><% $link ? '' : '' %><% $delete %><% $events %> <%init> my( $cust_bill, %opt ) = @_; +my $conf = new FS::Conf; + my $curuser = $FS::CurrentUser::CurrentUser; my($pre, $post) = ('', ''); @@ -18,6 +20,15 @@ my $link = $curuser->access_right('View invoices') ? qq!! : ''; +my $delete = ''; +if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') ) { + $delete = qq! (delete)!; +} + my $events = ''; #1.9 if ( $cust_bill->num_cust_event @@ -26,8 +37,8 @@ if ( $cust_bill->num_cust_event ) ) { $events = - qq!
( View invoice events )'; + qq!
( View invoice events )'; } # -- cgit v1.2.1