diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /bin/wipe-agent | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'bin/wipe-agent')
-rw-r--r-- | bin/wipe-agent | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/bin/wipe-agent b/bin/wipe-agent deleted file mode 100644 index 0e1846a..0000000 --- a/bin/wipe-agent +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/perl - -use strict; -use vars qw( $opt_a $opt_d ); -use Getopt::Std; -use FS::UID qw(adminsuidsetup); -use FS::Record qw(qsearch); -use FS::cust_main; - -die "i cancel and delete all customers of an agent - use the -d switch first and be careful - remove this line to enable"; - -getopts('a:d'); - -my $user = shift or die "usage: wipe-agent -a agentnum [ -d ] username\n"; -adminsuidsetup $user; - -die "no agentnum specified" unless $opt_a; - -foreach my $cust_main ( - - qsearch('cust_main', { 'agentnum' => $opt_a } ) - -) { - - warn "deleting ". $cust_main->custnum.': '. $cust_main->name. "\n"; - - unless ( $opt_d ) { #dry run - - my @cerrors = $cust_main->cancel( quiet=>1, nobill=>1 ); - if ( @cerrors ) { - die join(' / ', @cerrors); - } - - my $error = $cust_main->delete( 'delete_financials' => 1); - die $error if $error; - - } - -} |