X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Fcust_main-bulk_change;h=e0390127276260765619b934358642702096444c;hb=4a023e047c3a0c44606b7c549b1b4c6e157f8222;hp=32a6d7bd6072ff2684e8905625db37f38f9f0f6a;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;p=freeside.git diff --git a/bin/cust_main-bulk_change b/bin/cust_main-bulk_change index 32a6d7bd6..e03901272 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 () { } } + 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 . Multiple entries can be comma-separated. +-c: Cancel customer + user: Employee username =head1 BUGS