From: Ivan Kohler Date: Tue, 15 Sep 2015 18:38:39 +0000 (-0700) Subject: add cancel option, RT#38145 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=8927f51c07dce9dd1090d4825f6f3b5bffb6d4e5;ds=sidebyside add cancel option, RT#38145 --- 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