6 use FS::UID qw(adminsuidsetup);
7 use FS::Record qw(qsearchs);
12 my $user = shift or &usage;
15 $FS::cust_main::skip_fuzzyfiles = 1;
16 $FS::cust_main::skip_fuzzyfiles = 1;
17 $FS::cust_main::import = 1;
18 $FS::cust_main::import = 1;
22 unless ( /^\s*(\d+)\s*$/ ) {
23 warn "unparsable line: $_";
28 my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
29 unless ( $cust_main ) {
30 warn "unknown custnum $custnum\n";
35 $cust_main->payby($opt_p);
38 my $error = $cust_main->replace;
39 die "$error\n" if $error;
44 die "usage: cust_main-bulk_change -p NEW_PAYBY employee_username <custnums.txt\n";
53 cust_main-bulk_change -p NEW_PAYBY username <custnums.txt
57 Command-line tool to change the payby field for a group of customers.
59 -p: new payby, for example, I<CARD> or I<DCRD>.
61 user: Employee username
67 L<FS::payinfo_Mixin>, L<FS::cust_main>, L<FS::payby>