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;
20 unless ( /^\s*(\d+)\s*$/ ) {
21 warn "unparsable line: $_";
26 my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
27 unless ( $cust_main ) {
28 warn "unknown custnum $custnum\n";
33 $cust_main->payby($opt_p);
36 my $error = $cust_main->replace;
37 die "$error\n" if $error;
42 die "usage: cust_main-bulk_change -p NEW_PAYBY employee_username <custnums.txt\n";
51 cust_main-bulk_change -p NEW_PAYBY username <custnums.txt
55 Command-line tool to change the payby field for a group of customers.
57 -p: new payby, for example, I<CARD> or I<DCRD>.
59 user: Employee username
65 L<FS::payinfo_Mixin>, L<FS::cust_main>, L<FS::payby>