per-customer configurable payment date for auto CHEK/CARD, RT10813
[freeside.git] / bin / merge-referrals
1 #!/usr/bin/perl
2
3 use strict;
4 use FS::UID qw(adminsuidsetup);
5 use FS::Record qw(qsearch);
6 use FS::cust_main;
7
8 my $user = shift or die "usage: merge-customers username custnum\n";
9 adminsuidsetup $user;
10
11 my $custnum = shift or die "usage: merge-customers username custnum\n";
12
13 foreach my $cust_main (
14   qsearch('cust_main', { 'referral_custnum' => $custnum })
15 ) {
16   my $error = $cust_main->merge($custnum);
17   die $error if $error;
18 }
19
20 1;