[freeside-commits] branch FREESIDE_3_BRANCH updated. 8cb529e14f605eeb4bf9bf0faa3534e864d55746

Ivan ivan at 420.am
Tue Sep 15 11:38:45 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  8cb529e14f605eeb4bf9bf0faa3534e864d55746 (commit)
      from  62b4e6df5b5cf4bb38a8a65c9e298221c448abe1 (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 8cb529e14f605eeb4bf9bf0faa3534e864d55746
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Sep 15 11:38:43 2015 -0700

    add cancel option, RT#38145

diff --git a/bin/cust_main-bulk_change b/bin/cust_main-bulk_change
index 32a6d7b..e039012 100755
--- a/bin/cust_main-bulk_change
+++ b/bin/cust_main-bulk_change
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 use strict;
-use vars qw( $opt_a $opt_p $opt_t $opt_k );
+use vars qw( $opt_a $opt_p $opt_t $opt_k $opt_c );
 use Getopt::Std;
 use FS::UID qw(adminsuidsetup);
 use FS::Record qw(qsearch qsearchs);
@@ -9,7 +9,7 @@ use FS::cust_main;
 use FS::cust_tag;
 use FS::cust_pkg;
 
-getopts('a:p:t:k:');
+getopts('a:p:t:k:c:');
 
 my $user = shift or &usage;
 adminsuidsetup $user;
@@ -64,6 +64,11 @@ while (<STDIN>) {
     }
   }
 
+  if ( $opt_c ) {
+    my @error = $cust_main->cancel( 'reason' => $opt_c );
+    die join(' / ', @error). "\n" if @error;
+  }
+
 }
 
 sub usage {
@@ -76,7 +81,7 @@ cust_main-bulk_change
 
 =head1 SYNOPSIS
 
-  cust_main-bulk_change [ -a agentnum ] [ -p NEW_PAYBY ] [ -t tagnum ] [ -k old_pkgpart:new_pkgpart,... ] username <custnums.txt
+  cust_main-bulk_change [ -a agentnum ] [ -p NEW_PAYBY ] [ -t tagnum ] [ -k old_pkgpart:new_pkgpart,... ] [ -c reasonnum ] username <custnums.txt
 
 =head1 DESCRIPTION
 
@@ -90,6 +95,8 @@ Command-line tool to make bulk changes to a group of customers.
 
 -k: old_pkgpart:new_pkgpart, for example, I<5:4>.  Multiple entries can be comma-separated.
 
+-c: Cancel customer
+
 user: Employee username
 
 =head1 BUGS

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

Summary of changes:
 bin/cust_main-bulk_change |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list