remove invoice deletion (and ancient & unused config settings), RT#37157
authorIvan Kohler <ivan@freeside.biz>
Tue, 21 Jul 2015 22:16:12 +0000 (15:16 -0700)
committerIvan Kohler <ivan@freeside.biz>
Tue, 21 Jul 2015 22:16:12 +0000 (15:16 -0700)
FS/FS/Conf.pm
FS/FS/cust_bill.pm
httemplate/misc/delete-cust_bill.html [deleted file]
httemplate/misc/delete-cust_pkg_discount.html
httemplate/view/cust_bill.cgi
httemplate/view/cust_main/payment_history.html
httemplate/view/cust_main/payment_history/invoice.html
httemplate/view/cust_main/payment_history/voided_invoice.html

index 1d4a85a..4e1736b 100644 (file)
@@ -720,13 +720,6 @@ my $validate_email = sub { $_[0] =~
 @config_items = map { new FS::ConfItem $_ } (
 
   {
-    'key'         => 'address',
-    'section'     => 'deprecated',
-    'description' => 'This configuration option is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.',
-    'type'        => 'text',
-  },
-
-  {
     'key'         => 'event_log_level',
     'section'     => 'notification',
     'description' => 'Store events in the internal log if they are at least this severe.  "info" is the default, "debug" is very detailed and noisy.',
@@ -1046,13 +1039,6 @@ my $validate_email = sub { $_[0] =~
   },
 
   {
-    'key'         => 'deleteinvoices',
-    'section'     => 'UI',
-    'description' => 'Enable invoices deletions.  Be very careful!  Deleting an invoice will remove all traces that the invoice ever existed!  Normally, you would void or apply a credit against the invoice instead.',
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'deletecredits',
     #not actually deprecated yet
     #'section'     => 'deprecated',
@@ -1070,20 +1056,6 @@ my $validate_email = sub { $_[0] =~
   },
 
   {
-    'key'         => 'unapplypayments',
-    'section'     => 'deprecated',
-    'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed payments.',
-    'type'        => 'checkbox',
-  },
-
-  {
-    'key'         => 'unapplycredits',
-    'section'     => 'deprecated',
-    'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable "unapplication" of unclosed credits.',
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'dirhash',
     'section'     => 'shell',
     'description' => 'Optional numeric value to control directory hashing.  If positive, hashes directories for the specified number of levels from the front of the username.  If negative, hashes directories for the specified number of levels from the end of the username.  Some examples: <ul><li>1: user -> <a href="#home">/home</a>/u/user<li>2: user -> <a href="#home">/home</a>/u/s/user<li>-1: user -> <a href="#home">/home</a>/r/user<li>-2: user -> <a href="#home">home</a>/r/e/user</ul>',
@@ -1670,13 +1642,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'invoice_send_receipts',
-    'section'     => 'deprecated',
-    'description' => '<b>DEPRECATED</b>, this used to send an invoice copy on payments and credits.  See the payment_receipt_email and XXXX instead.',
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'payment_receipt',
     'section'     => 'notification',
     'description' => 'Send payment receipts.',
@@ -1874,13 +1839,6 @@ and customer address. Include units.',
 #  },
 
   {
-    'key'         => 'report_template',
-    'section'     => 'deprecated',
-    'description' => 'Deprecated template file for reports.',
-    'type'        => 'textarea',
-  },
-
-  {
     'key'         => 'maxsearchrecordsperpage',
     'section'     => 'UI',
     'description' => 'If set, number of search records to return per page.',
@@ -2687,13 +2645,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'paymentforcedtobatch',
-    'section'     => 'deprecated',
-    'description' => 'See batch-enable_payby and realtime-disable_payby.  Used to (for CHEK): Cause per customer payment entry to be forced to a batch processor rather than performed realtime.',
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'svc_acct-notes',
     'section'     => 'deprecated',
     'description' => 'Extra HTML to be displayed on the Account View screen.',
@@ -2768,13 +2719,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'users-allow_comp',
-    'section'     => 'deprecated',
-    'description' => '<b>DEPRECATED</b>, enable the <i>Complimentary customer</i> access right instead.  Was: Usernames (Freeside users, created with <a href="../docs/man/bin/freeside-adduser.html">freeside-adduser</a>) which can create complimentary customers, one per line.  If no usernames are entered, all users can create complimentary accounts.',
-    'type'        => 'textarea',
-  },
-
-  {
     'key'         => 'credit_card-recurring_billing_flag',
     'section'     => 'billing',
     'description' => 'This controls when the system passes the "recurring_billing" flag on credit card transactions.  If supported by your processor (and the Business::OnlinePayment processor module), passing the flag indicates this is a recurring transaction and may turn off the CVV requirement. ',
@@ -3383,27 +3327,6 @@ and customer address. Include units.',
   },
 
   {
-    'key'         => 'echeck-void',
-    'section'     => 'deprecated',
-    'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable local-only voiding of echeck payments in addition to refunds against the payment gateway',
-    'type'        => 'checkbox',
-  },
-
-  {
-    'key'         => 'cc-void',
-    'section'     => 'deprecated',
-    'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable local-only voiding of credit card payments in addition to refunds against the payment gateway',
-    'type'        => 'checkbox',
-  },
-
-  {
-    'key'         => 'unvoid',
-    'section'     => 'deprecated',
-    'description' => '<B>DEPRECATED</B>, now controlled by ACLs.  Used to enable unvoiding of voided payments',
-    'type'        => 'checkbox',
-  },
-
-  {
     'key'         => 'address1-search',
     'section'     => 'UI',
     'description' => 'Enable the ability to search the address1 field from the quick customer search.  Not recommended in most cases as it tends to bring up too many search results - use explicit address searching from the advanced customer search instead.',
@@ -3432,12 +3355,6 @@ and customer address. Include units.',
     'per_agent'   => 1,
   },
 
-  { 'key'         => 'referral_credit',
-    'section'     => 'deprecated',
-    'description' => "Used to enable one-time referral credits in the amount of one month <i>referred</i> customer's recurring fee (irregardless of frequency).  Replace with a billing event on appropriate packages.",
-    'type'        => 'checkbox',
-  },
-
   { 'key'         => 'selfservice_server-cache_module',
     'section'     => 'self-service',
     'description' => 'Module used to store self-service session information.  All modules handle any number of self-service servers.  Cache::SharedMemoryCache is appropriate for a single database / single Freeside server.  Cache::FileCache is useful for multiple databases on a single server, or when IPC::ShareLite is not available (i.e. FreeBSD).', #  _Database stores session information in the database and is appropriate for multiple Freeside servers, but may be slower.',
@@ -5998,48 +5915,6 @@ and customer address. Include units.',
     'type'        => 'text',
   },
 
-  { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "bindprimary", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "bindsecondaries", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "bsdshellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "cyrus", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "cp_app", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "erpcdmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "icradiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "icradius_mysqldest", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "icradius_mysqlsource", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "icradius_secrets", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "maildisablecatchall", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "mxmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "nsmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "arecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "cnamerecords", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "nismachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "qmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "radiusmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "sendmailconfigpath", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "sendmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "sendmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "shellmachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "shellmachine-useradd", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "shellmachine-userdel", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "shellmachine-usermod", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "shellmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "radiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "textradiusprepend", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "username_policy", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "vpopmailmachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "vpopmailrestart", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "safe-part_pkg", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "selfservice_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "signup_server-quiet", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "signup_server-email", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "vonage-username", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "vonage-password", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-  { key => "vonage-fromnumber", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
-
 );
 
 1;
index 6a4fa1e..b694924 100644 (file)
@@ -267,14 +267,13 @@ sub void {
 
 =item delete
 
-This method now works but you probably shouldn't use it.  Instead, apply a
-credit against the invoice, or use the new void method.
+DO NOT USE THIS METHOD.  Instead, apply a credit against the invoice, or use
+the B<void> method.
 
-Using this method to delete invoices outright is really, really bad.  There
-would be no record you ever posted this invoice, and there are no check to
-make sure charged = 0 or that there are no associated cust_bill_pkg records.
+This is only for internal use by V<void>, which is what you should be using.
 
-Really, don't use it.
+DO NOT USE THIS METHOD.  Whatever reason you think you have is almost certainly
+wrong.  Use B<void>, that's what it is for.  Really.  This means you.
 
 =cut
 
diff --git a/httemplate/misc/delete-cust_bill.html b/httemplate/misc/delete-cust_bill.html
deleted file mode 100644 (file)
index 3a642b0..0000000
+++ /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;
-
-</%init>
index 0bdaa13..58a99ca 100644 (file)
@@ -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;
index f1bcf4d..2ff3ca8 100755 (executable)
@@ -9,30 +9,13 @@ function areyousure(href, message) {
 }
 </SCRIPT>
 
-% 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 ) {
-  &nbsp;|&nbsp;
-%   }
-%   if ( $can_delete ) {
-    <A href="" onclick="areyousure(\
-      '<%$p%>misc/delete-cust_bill.html?<% $invnum %>',\
-      <% mt('Are you sure you want to delete this invoice?') |js_string %>)"\
-    TITLE = "<% mt('Delete this invoice from the database completely') |h %>">\
-    <% emt('Delete this invoice') |h %></A>
-%   }
-%   if ( $can_void or $can_delete ) {
-  <BR><BR>
-%   }
+    <BR><BR>
 % }
 
 % if ( $cust_bill->owed > 0
index 458469c..e3599bc 100644 (file)
@@ -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',
index acb1d69..be4e93e 100644 (file)
@@ -1,4 +1,4 @@
-<% $link %><% $invoice %><% $link ? '</A>' : '' %><% "$void$delete$under" %>
+<% $link %><% $invoice %><% $link ? '</A>' : '' %><% "$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'})
index 3d81e66..ea61f84 100644 (file)
@@ -10,7 +10,7 @@
 % }
 <% mt("on [_1]", time2str($date_format, $cust_bill_void->void_date) ) |h %> 
 </I>
-<% "$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'})