[freeside-commits] branch master updated. a6dd5bc6ba6c655b1707a016db4e97e269b718e5

Ivan ivan at 420.am
Wed Jun 19 15:29:59 PDT 2013


The branch, master has been updated
       via  a6dd5bc6ba6c655b1707a016db4e97e269b718e5 (commit)
       via  66906f54d1099dcae84e69240c3a16bc9a82c37f (commit)
       via  fa2d8d66b29628e95a8a3aad05e59cbb173f4671 (commit)
      from  b75f93f4842bcbb89fc220dba0291ede4d8af300 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a6dd5bc6ba6c655b1707a016db4e97e269b718e5
Merge: 66906f5 b75f93f
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 19 15:29:55 2013 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit 66906f54d1099dcae84e69240c3a16bc9a82c37f
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 19 15:28:23 2013 -0700

    remove customer deletion

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index bbd73a3..75bba36 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1068,7 +1068,7 @@ sub reason_type_options {
   {
     '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 apply a credit against the invoice instead.',  #invoice voiding?
+    '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',
   },
 

commit fa2d8d66b29628e95a8a3aad05e59cbb173f4671
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jun 19 15:27:21 2013 -0700

    remove customer deletion

diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index d7e5a17..3f6073e 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -118,7 +118,6 @@ tie my %rights, 'Tie::IxHash',
     'Complimentary customer', #aka users-allow_comp 
     'Merge customer',
     'Merge customer across agents',
-    { rightname=>'Delete customer', desc=>"Enable customer deletions. Be very careful! Deleting a customer will remove all traces that this customer ever existed! It should probably only be used when auditing a legacy database. Normally, you cancel all of a customer's packages if they cancel service." }, #aka. deletecustomers
     'Bill customer now', #NEW
     'Bulk send customer notices', #NEW
     { rightname=>'View customers of all agents', global=>1 },
@@ -405,7 +404,6 @@ Most (but not all) right names.
 sub default_superuser_rights {
   my $class = shift;
   my %omit = map { $_=>1 } (
-    'Delete customer',
     'Delete invoices',
     'Delete payment',
     'Delete credit', #?
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 982c340..bbd73a3 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1066,13 +1066,6 @@ sub reason_type_options {
   },
 
   {
-    'key'         => 'deletecustomers',
-    'section'     => 'UI',
-    'description' => 'Enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that the customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers\' packages if they cancel service.',
-    'type'        => 'checkbox',
-  },
-
-  {
     '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 apply a credit against the invoice instead.',  #invoice voiding?
diff --git a/httemplate/L10N b/httemplate/L10N
index 242fede..57595a0 100644
--- a/httemplate/L10N
+++ b/httemplate/L10N
@@ -480,7 +480,6 @@ L ./misc/process/cust_main-import_charges.cgi
 L ./misc/process/rate_edit_excel.html
 L ./misc/process/rate-import.html
 L ./misc/process/meta-import.cgi
-L ./misc/process/delete-customer.cgi
 L ./misc/phone_avail-import.html
 L ./misc/part_device-import.html
 L ./misc/nms-add_iface.html
@@ -508,7 +507,6 @@ H ./misc/change_pkg.cgi
 L ./misc/rate-import.html
 L ./misc/meta-import.cgi
 L ./misc/delete-cust_pkg_discount.html
-L ./misc/delete-customer.cgi
 L ./misc/delete-domain_record.cgi
 L ./misc/cdr.cgi
 
diff --git a/httemplate/misc/delete-customer.cgi b/httemplate/misc/delete-customer.cgi
deleted file mode 100755
index 203ed36..0000000
--- a/httemplate/misc/delete-customer.cgi
+++ /dev/null
@@ -1,64 +0,0 @@
-<% include('/elements/header.html', 'Delete customer') %>
-
-<% include('/elements/error.html') %>
-
-<FORM ACTION="<% popurl(1) %>process/delete-customer.cgi" METHOD=POST>
-<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum |h %>">
-
-%if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
-  Move uncancelled packages to customer number 
-  <INPUT TYPE="text" NAME="new_custnum" VALUE="<% $new_custnum |h %>"><BR><BR>
-%}
-
-This will <B>completely remove</B> all traces of this customer record.  This
-is <B>not</B> what you want if this is a real customer who has simply
-canceled service with you.  For that, cancel all of the customer's packages.
-(you can optionally hide cancelled customers with the <A HREF="../config/config-view.cgi#hidecancelledcustomers">hidecancelledcustomers</A> configuration option)
-<BR>
-<BR>Are you <B>absolutely sure</B> you want to delete this customer?
-<BR><INPUT TYPE="submit" VALUE="Yes">
-</FORM>
-
-<% include('/elements/footer.html') %>
-
-%#Deleting a customer you have financial records on (i.e. credits) is
-%#typically considered fraudulant bookkeeping.  Remember, deleting   
-%#customers should ONLY be used for completely bogus records.  You should
-%#NOT delete real customers who simply discontinue service.
-%#
-%#For real customers who simply discontinue service, cancel all of the
-%#customer's packages.  Customers with all cancelled packages are not  
-%#billed.  There is no need to take further action to prevent billing on
-%#customers with all cancelled packages.
-%#
-%#Also see the "hidecancelledcustomers" and "hidecancelledpackages"
-%#configuration options, which will allow you to surpress the display of
-%#cancelled customers and packages, respectively.
-
-<%init>
-
-my $conf = new FS::Conf;
-die "Customer deletions not enabled in configuration"
-  unless $conf->exists('deletecustomers');
-
-die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Delete customer');
-
-my($custnum, $new_custnum);
-if ( $cgi->param('error') ) {
-  $custnum = $cgi->param('custnum');
-  $new_custnum = $cgi->param('new_custnum');
-} else {
-  my($query) = $cgi->keywords;
-  $query =~ /^(\d+)$/ or die "Illegal query: $query";
-  $custnum = $1;
-  $new_custnum = '';
-}
-my $cust_main = qsearchs( {
-  'table'     => 'cust_main',
-  'hashref'   => { 'custnum' => $custnum },
-  'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-} )
-  or die 'Unknown custnum';
-
-</%init>
diff --git a/httemplate/misc/merge_cust.html b/httemplate/misc/merge_cust.html
index 9c869fa..c923b7b 100644
--- a/httemplate/misc/merge_cust.html
+++ b/httemplate/misc/merge_cust.html
@@ -43,7 +43,7 @@ function do_submit_merge() {
                'curr_value'  => scalar($cgi->param('new_custnum')),
   &>
 
-% if ( $conf->exists('deletecustomers') ) {
+% if ( 0 ) { #we start supporting payment info merge again in some way
 
 %   if ( scalar($cust_main->ncancelled_pkgs) ) {
       <TR>
@@ -67,7 +67,7 @@ function do_submit_merge() {
              'value'       => 'Y',
              'curr_value'  => scalar($cgi->param('merge')),
         &>
-        Merge invoices, payments/credits, notes, tickets and delete this customer.
+        Merge invoices, payments/credits, notes, tickets and delete<!-- ^Warchive --> this customer.
       </TD>
     </TR>
 % }
diff --git a/httemplate/misc/process/delete-customer.cgi b/httemplate/misc/process/delete-customer.cgi
deleted file mode 100755
index 1201131..0000000
--- a/httemplate/misc/process/delete-customer.cgi
+++ /dev/null
@@ -1,33 +0,0 @@
-%if ( $error ) {
-%  $cgi->param('error', $error);
-<% $cgi->redirect(popurl(2). "delete-customer.cgi?". $cgi->query_string ) %>
-%} elsif ( $new_custnum ) {
-<% $cgi->redirect(popurl(3). "view/cust_main.cgi?$new_custnum") %>
-%} else {
-<% $cgi->redirect(popurl(3)) %>
-%}
-<%init>
-
-my $conf = new FS::Conf;
-die "Customer deletions not enabled in configuration"
-  unless $conf->exists('deletecustomers');
-
-die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Delete customer');
-
-$cgi->param('custnum') =~ /^(\d+)$/;
-my $custnum = $1;
-my $new_custnum;
-if ( $cgi->param('new_custnum') ) {
-  $cgi->param('new_custnum') =~ /^(\d+)$/
-    or die "Illegal new customer number: ". $cgi->param('new_custnum');
-  $new_custnum = $1;
-} else {
-  $new_custnum = '';
-}
-my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
-  or die "Customer not found: $custnum";
-
-my $error = $cust_main->delete('new_custnum' => $new_custnum);
-
-</%init>
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 1f9e0f9..430c50c 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -93,7 +93,7 @@ function areyousure(href, message) {
 
 % if (     $curuser->access_right('Merge customer')
 %      and (    scalar($cust_main->ncancelled_pkgs)
-%            || $conf->exists('deletecustomers')
+%            # || we start supporting payment info merge again in some way
 %          )
 %    )
 % {
@@ -108,12 +108,6 @@ function areyousure(href, message) {
   &> | 
 % } 
 
-% if ( $conf->exists('deletecustomers')
-%        && $curuser->access_right('Delete customer')
-%      ) {
-  <A HREF="<% $p %>misc/delete-customer.cgi?<% $custnum%>"><% mt('Delete this customer') |h %></A> | 
-% } 
-
 % unless ( $conf->exists('disable_customer_referrals') ) { 
   <A HREF="<% $p %>edit/cust_main.cgi?referral_custnum=<% $custnum %>"><% mt('Refer a new customer') |h %></A> | 
   <A HREF="<% $p %>search/cust_main.cgi?referral_custnum=<% $custnum %>"><% mt('View this customer\'s referrals') |h %></A>

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/AccessRight.pm                        |    2 -
 FS/FS/Conf.pm                               |    9 +---
 httemplate/L10N                             |    2 -
 httemplate/misc/delete-customer.cgi         |   64 ---------------------------
 httemplate/misc/merge_cust.html             |    4 +-
 httemplate/misc/process/delete-customer.cgi |   33 --------------
 httemplate/view/cust_main.cgi               |    8 +---
 7 files changed, 4 insertions(+), 118 deletions(-)
 delete mode 100755 httemplate/misc/delete-customer.cgi
 delete mode 100755 httemplate/misc/process/delete-customer.cgi




More information about the freeside-commits mailing list