diff options
author | ivan <ivan> | 2010-10-20 02:07:02 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-10-20 02:07:02 +0000 |
commit | a8e4b1744a6bbd2e1509b58e73b1d52751563880 (patch) | |
tree | 77ffb2638f193f748c36423d1dabd65ee81d6d8a /bin/merge-referrals | |
parent | 633510de5405b966d160ab95ad396bc601764603 (diff) |
customer merging, RT#10247
Diffstat (limited to 'bin/merge-referrals')
-rw-r--r-- | bin/merge-referrals | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/merge-referrals b/bin/merge-referrals new file mode 100644 index 000000000..ba07a81c6 --- /dev/null +++ b/bin/merge-referrals @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +use strict; +use FS::UID qw(adminsuidsetup); +use FS::Record qw(qsearchs); +use FS::cust_main; + +my $user = shift or die "usage: merge-customers username custnum\n"; +adminsuidsetup $user; + +my $custnum = shift or die "usage: merge-customers username custnum\n"; + +foreach my $cust_main ( + qsearch('cust_main', { 'referral_custnum' => $custnum }) +) { + my $error = $cust_main->merge($custnum); + die $error if $error; +} + +1; |