From dba9cc11f7ad2337506e40ed2aa6bc9e890cc977 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 21 Jul 2015 15:16:12 -0700 Subject: remove invoice deletion (and ancient & unused config settings), RT#37157 --- httemplate/misc/delete-cust_bill.html | 21 --------------------- httemplate/misc/delete-cust_pkg_discount.html | 2 +- httemplate/view/cust_bill.cgi | 21 ++------------------- httemplate/view/cust_main/payment_history.html | 4 ++-- .../view/cust_main/payment_history/invoice.html | 10 +--------- .../cust_main/payment_history/voided_invoice.html | 10 +--------- 6 files changed, 7 insertions(+), 61 deletions(-) delete mode 100644 httemplate/misc/delete-cust_bill.html (limited to 'httemplate') diff --git a/httemplate/misc/delete-cust_bill.html b/httemplate/misc/delete-cust_bill.html deleted file mode 100644 index 3a642b0e9..000000000 --- a/httemplate/misc/delete-cust_bill.html +++ /dev/null @@ -1,21 +0,0 @@ -% if ( $error ) { -% errorpage($error); -% } else { -<% $cgi->redirect($p. "view/cust_main.cgi?". $custnum) %> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Delete invoices'); - -#untaint invnum -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ || die "Illegal crednum"; -my $invnum = $1; - -my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); -my $custnum = $cust_bill->custnum; - -my $error = $cust_bill->delete; - - diff --git a/httemplate/misc/delete-cust_pkg_discount.html b/httemplate/misc/delete-cust_pkg_discount.html index 0bdaa13b3..58a99ca67 100644 --- a/httemplate/misc/delete-cust_pkg_discount.html +++ b/httemplate/misc/delete-cust_pkg_discount.html @@ -13,7 +13,7 @@ my $curuser = $FS::CurrentUser::CurrentUser; #XXX ACL to remove discounts #die "access denied" -# unless $curuser->access_right('Delete invoices'); +# unless $curuser->access_right('Delete discounts'); #untaint pkgdiscountnum my($query) = $cgi->keywords; diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index f1bcf4d52..2ff3ca883 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -9,30 +9,13 @@ function areyousure(href, message) { } -% if ( !$cust_bill->closed ) { # otherwise allow no changes -% my $can_delete = $conf->exists('deleteinvoices') -% && $curuser->access_right('Delete invoices'); -% my $can_void = $curuser->access_right('Void invoices'); -% if ( $can_void ) { +% if ( !$cust_bill->closed && $curuser->access_right('Void invoices') ) { <& /elements/popup_link.html, 'label' => emt('Void this invoice'), 'actionlabel' => emt('Void this invoice'), 'action' => $p.'misc/void-cust_bill.html?invnum='.$invnum, &> -% } -% if ( $can_void and $can_delete ) { -  |  -% } -% if ( $can_delete ) { - \ - <% emt('Delete this invoice') |h %> -% } -% if ( $can_void or $can_delete ) { -

-% } +

% } % if ( $cust_bill->owed > 0 diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 458469cb1..e3599bc06 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -217,7 +217,7 @@ my %opt = ( qw( card_refund-days date_format ) ), ( map { $_ => $conf->exists($_) } - qw( deleteinvoices deletepayments deleterefunds pkg-balances + qw( deletepayments deleterefunds pkg-balances cust_credit_bill_pkg-manual cust_bill_pay_pkg-manual ) ), @@ -226,7 +226,7 @@ my %opt = ( #rights ( map { $_ => $curuser->access_right($_) } ( - 'View invoices', 'Void invoices', 'Unvoid invoices', 'Delete invoices', + 'View invoices', 'Void invoices', 'Unvoid invoices', 'Apply payment', 'Refund credit card payment', 'Refund Echeck payment', 'Credit card void', 'Echeck void', 'Void payments', 'Unvoid payments', 'Delete payment', 'Unapply payment', diff --git a/httemplate/view/cust_main/payment_history/invoice.html b/httemplate/view/cust_main/payment_history/invoice.html index acb1d6956..be4e93e31 100644 --- a/httemplate/view/cust_main/payment_history/invoice.html +++ b/httemplate/view/cust_main/payment_history/invoice.html @@ -1,4 +1,4 @@ -<% $link %><% $invoice %><% $link ? '' : '' %><% "$void$delete$under" %> +<% $link %><% $invoice %><% $link ? '' : '' %><% "$void$under" %> <%init> my( $cust_bill, %opt ) = @_; @@ -34,14 +34,6 @@ if ( $cust_bill->closed !~ /^Y/i && $opt{'Void invoices'} ) { ')'; } -my $delete = ''; -$delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum", - emt('Are you sure you want to delete this invoice?'), - emt('Delete this invoice from the database completely'), - emt('delete') - ) - if ( $opt{'deleteinvoices'} && $opt{'Delete invoices'} ); - my $events = ''; if ( $cust_bill->num_cust_event && ($opt{'Billing event reports'} || $opt{'View customer billing events'}) diff --git a/httemplate/view/cust_main/payment_history/voided_invoice.html b/httemplate/view/cust_main/payment_history/voided_invoice.html index 3d81e662f..ea61f8446 100644 --- a/httemplate/view/cust_main/payment_history/voided_invoice.html +++ b/httemplate/view/cust_main/payment_history/voided_invoice.html @@ -10,7 +10,7 @@ % } <% mt("on [_1]", time2str($date_format, $cust_bill_void->void_date) ) |h %> -<% "$unvoid$delete$under" %> +<% "$unvoid$under" %> <%init> my( $cust_bill_void, %opt ) = @_; @@ -35,14 +35,6 @@ $unvoid = areyousure_link("${p}misc/unvoid-cust_bill_void.html?invnum=". $cust_b ) if $cust_bill_void->closed !~ /^Y/ && $opt{'Unvoid invoices'}; -my $delete = ''; -$delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum", - emt('Are you sure you want to delete this invoice?'), - emt('Delete this invoice from the database completely'), - emt('delete') - ) - if $opt{'deleteinvoices'} && $opt{'Delete invoices'}; - my $events = ''; if ( $cust_bill_void->num_cust_event && ($opt{'Billing event reports'} || $opt{'View customer billing events'}) -- cgit v1.2.1