4 use FS::UID qw(adminsuidsetup);
5 use FS::Record qw(qsearch);
8 die "this removes all customers in your database except for customer 1 - remove this line to enable";
10 my $user = shift or die "usage: wipe-customers username\n";
13 #this isn't terribly efficient, but the idea was clearing out a test database,
14 #not actually destroying a large amount of data
16 foreach my $cust_main (
18 qsearch('cust_main', { 'custnum' => { op=>'!=', value=>'1' } } )
22 my @cerrors = $cust_main->cancel( quiet=>1, nobill=>1 );
24 die join(' / ', @cerrors);
27 my $error = $cust_main->delete( 'delete_financials' => 1);