projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58f6502
)
bulk remove email address, RT#75861
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 11 May 2017 16:50:11 +0000
(09:50 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 11 May 2017 16:50:11 +0000
(09:50 -0700)
bin/remove-cust_main_invoice
[new file with mode: 0755]
patch
|
blob
diff --git a/bin/remove-cust_main_invoice
b/bin/remove-cust_main_invoice
new file mode 100755
(executable)
index 0000000..
da17a7e
--- /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";
+}