4 use vars qw($opt_t $opt_e);
6 use FS::UID qw(adminsuidsetup);
7 use FS::Record qw(qsearch qsearchs);
13 my $user = shift or die &usage;
19 $FS::Record::nowarn_identical = 1;
23 $opt_t =~ /^(\d+)$/ or die "invalid reason_type";
24 @reason = qsearch('reason', { reason_type => $1 } );
25 die "no reasons found\n" unless @reason;
27 die "no reason_type specified\n";
30 foreach my $reason ( @reason ) {
32 $reason->disabled('');
34 $reason->disabled('Y');
36 my $error = $reason->replace
43 die "Usage:\n\n freeside-disable-reasons -t reason_type [ -e ] user\n";
48 freeside-disable-reasons - Command line tool to set the disabled column for reasons
52 freeside-disable-reasons -t reason_type [ -e ] user
56 Disables the reasons of the specified reason type.
57 Enables instead if -e is specified.
61 L<FS::reason>, L<FS::reason_type>