[freeside-commits]
freeside/FS/bin freeside-prune-applications, NONE,
1.1 freeside-upgrade, 1.6, 1.7
Jeff Finucane,420,,
jeff at wavetail.420.am
Wed Feb 28 21:13:15 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail:/tmp/cvs-serv12672/FS/bin
Modified Files:
freeside-upgrade
Added Files:
freeside-prune-applications
Log Message:
dangling cust_credit_refund not allowed
Index: freeside-upgrade
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-upgrade,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- freeside-upgrade 27 Feb 2007 01:48:07 -0000 1.6
+++ freeside-upgrade 1 Mar 2007 05:13:13 -0000 1.7
@@ -8,6 +8,7 @@
use FS::UID qw(adminsuidsetup checkeuid datasrc ); #getsecrets);
use FS::CurrentUser;
use FS::Schema qw( dbdef dbdef_dist reload_dbdef );
+use FS::Misc qw(prune_applications);
die "Not running uid freeside!" unless checkeuid();
@@ -40,6 +41,13 @@
dbdef->update_schema( dbdef_dist, $dbh );
}
+my $hashref = {};
+$hashref->{dry_run} = 1 if $DRY_RUN;
+$hashref->{debug} = 1 if $DEBUG;
+print join "\n", prune_applications($hashref);
+print "\n" if $DRY_RUN;
+
+
$dbh->commit or die $dbh->errstr;
dbdef_create($dbh, $dbdef_file);
--- NEW FILE: freeside-prune-applications ---
#!/usr/bin/perl -w
use strict;
use vars qw($opt_d $opt_q $opt_v); # $opt_n instead of $opt_d?
use vars qw($DEBUG $DRY_RUN);
use Getopt::Std;
use FS::UID qw(adminsuidsetup checkeuid);
use FS::Misc qw(prune_applications);
die "Not running uid freeside!" unless checkeuid();
getopts("dq");
$DEBUG = !$opt_q;
#$DEBUG = $opt_v;
$DRY_RUN = $opt_d;
my $user = shift or die &usage;
my $dbh = adminsuidsetup($user);
my $hashref = {};
$hashref->{dry_run} = 1 if $DRY_RUN;
$hashref->{debug} = 1 if $DEBUG;
print join "\n", prune_applications($hashref);
print "\n" if $DRY_RUN;
$dbh->commit or die $dbh->errstr;
###
sub usage {
die "Usage:\n freeside-prune-applications [ -d ] [ -q | -v ] user\n";
}
=head1 NAME
freeside-prune-applications - Removes stray applications of credit, payment to
bills, refunds, etc.
=head1 SYNOPSIS
freeside-prune-applications [ -d ] [ -q | -v ]
=head1 DESCRIPTION
Reads your existing database schema and updates it to match the current schema,
adding any columns or tables necessary.
[ -d ]: Dry run; display affected records (to STDOUT) only, but do not
remove them.
[ -q ]: Run quietly. This may become the default at some point.
[ -v ]: Run verbosely, sending debugging information to STDERR. This is the
current default.
=head1 SEE ALSO
=cut
More information about the freeside-commits
mailing list