4 use vars qw($opt_d $opt_q $opt_v); # $opt_n instead of $opt_d?
5 use vars qw($DEBUG $DRY_RUN);
7 use FS::UID qw(adminsuidsetup checkeuid);
8 use FS::Misc::prune qw(prune_applications);
10 die "Not running uid freeside!" unless checkeuid();
19 my $user = shift or die &usage;
20 my $dbh = adminsuidsetup($user);
24 $hashref->{dry_run} = 1 if $DRY_RUN;
25 $hashref->{debug} = 1 if $DEBUG;
27 print join "\n", prune_applications($hashref);
28 print "\n" if $DRY_RUN;
30 $dbh->commit or die $dbh->errstr;
35 die "Usage:\n freeside-prune-applications [ -d ] [ -q | -v ] user\n";
40 freeside-prune-applications - Removes stray applications of credit, payment to
45 freeside-prune-applications [ -d ] [ -q | -v ]
49 Reads your existing database schema and updates it to match the current schema,
50 adding any columns or tables necessary.
52 [ -d ]: Dry run; display affected records (to STDOUT) only, but do not
55 [ -q ]: Run quietly. This may become the default at some point.
57 [ -v ]: Run verbosely, sending debugging information to STDERR. This is the