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:24:29 +0000 (15:24 -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)
@@ -719,13 +719,6 @@ my $validate_email = sub { $_[0] =~
 
 @config_items = map { new FS::ConfItem $_ } (
 
 
 @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',
   {
     'key'         => 'event_log_level',
     'section'     => 'notification',
@@ -1045,13 +1038,6 @@ my $validate_email = sub { $_[0] =~
     'per_locale'  => 1,
   },
 
     'per_locale'  => 1,
   },
 
-  {
-    '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
   {
     'key'         => 'deletecredits',
     #not actually deprecated yet
@@ -1069,20 +1055,6 @@ my $validate_email = sub { $_[0] =~
     'type'        => 'checkbox',
   },
 
     'type'        => 'checkbox',
   },
 
-  {
-    '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',
   {
     'key'         => 'dirhash',
     'section'     => 'shell',
@@ -1669,13 +1641,6 @@ and customer address. Include units.',
     'type'        => 'checkbox',
   },
 
     'type'        => 'checkbox',
   },
 
-  {
-    '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',
   {
     'key'         => 'payment_receipt',
     'section'     => 'notification',
@@ -1873,13 +1838,6 @@ and customer address. Include units.',
 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
 #  },
 
 #    'description' => 'Directory which contains domain registry information.  Each registry is a directory.',
 #  },
 
-  {
-    'key'         => 'report_template',
-    'section'     => 'deprecated',
-    'description' => 'Deprecated template file for reports.',
-    'type'        => 'textarea',
-  },
-
   {
     'key'         => 'maxsearchrecordsperpage',
     'section'     => 'UI',
   {
     'key'         => 'maxsearchrecordsperpage',
     'section'     => 'UI',
@@ -2686,13 +2644,6 @@ and customer address. Include units.',
     'type'        => 'checkbox',
   },
 
     'type'        => 'checkbox',
   },
 
-  {
-    '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',
   {
     'key'         => 'svc_acct-notes',
     'section'     => 'deprecated',
@@ -2767,13 +2718,6 @@ and customer address. Include units.',
     'validate'    => $validate_email,
   },
 
     'validate'    => $validate_email,
   },
 
-  {
-    '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',
   {
     'key'         => 'credit_card-recurring_billing_flag',
     'section'     => 'billing',
@@ -3382,27 +3326,6 @@ and customer address. Include units.',
     'per_agent'   => 1,
   },
 
     'per_agent'   => 1,
   },
 
-  {
-    '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',
   {
     'key'         => 'address1-search',
     'section'     => 'UI',
@@ -3432,12 +3355,6 @@ and customer address. Include units.',
     'per_agent'   => 1,
   },
 
     '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.',
   { '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',
   },
 
     '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;
 );
 
 1;
index 6a4fa1e..b694924 100644 (file)
@@ -267,14 +267,13 @@ sub void {
 
 =item delete
 
 
 =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
 
 
 =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"
 
 #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;
 
 #untaint pkgdiscountnum
 my($query) = $cgi->keywords;
index f1bcf4d..2ff3ca8 100755 (executable)
@@ -9,30 +9,13 @@ function areyousure(href, message) {
 }
 </SCRIPT>
 
 }
 </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,
     &>
     <& /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
 % }
 
 % 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( 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
           )
   ),
             cust_credit_bill_pkg-manual cust_bill_pay_pkg-manual
           )
   ),
@@ -226,7 +226,7 @@ my %opt = (
   #rights
   ( map { $_ => $curuser->access_right($_) }
       (
   #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',
         '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 ) = @_;
 <%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'})
 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>
 % }
 <% mt("on [_1]", time2str($date_format, $cust_bill_void->void_date) ) |h %> 
 </I>
-<% "$unvoid$delete$under" %>
+<% "$unvoid$under" %>
 <%init>
 
 my( $cust_bill_void, %opt ) = @_;
 <%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'};
 
                          )
   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'})
 my $events = '';
 if ( $cust_bill_void->num_cust_event
      && ($opt{'Billing event reports'} || $opt{'View customer billing events'})