diff options
-rwxr-xr-x | bin/remove-cust_main_invoice | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/remove-cust_main_invoice b/bin/remove-cust_main_invoice new file mode 100755 index 000000000..da17a7e29 --- /dev/null +++ b/bin/remove-cust_main_invoice @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use strict; +use FS::UID qw( adminsuidsetup ); +use FS::Record qw( qsearch ); + +my $user = shift or die &usage; + +my $email = shift or die &usage; + +adminsuidsetup $user; + +foreach my $cust_main_invoice ( + qsearch('cust_main_invoice', { 'dest' => $email } ) +) { + my $error = $cust_main_invoice->delete; + die $error if $error; +} + +sub usage { + "Usage: remove-cust_main_invoice username email\@address"; +} |