projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 73211 - Add billing event: remove customer tag
[freeside.git]
/
bin
/
bulk_void
diff --git
a/bin/bulk_void
b/bin/bulk_void
index
c75da5d
..
8f0c882
100755
(executable)
--- a/
bin/bulk_void
+++ b/
bin/bulk_void
@@
-6,7
+6,7
@@
use vars qw( %opt );
use FS::Misc::Getopt;
use FS::Record qw(qsearch qsearchs dbh);
use FS::Misc::Getopt;
use FS::Record qw(qsearch qsearchs dbh);
-getopts('
s:e:
cpiXr:t:');
+getopts('cpiXr:t:');
my $dbh = dbh;
$FS::UID::AutoCommit = 0;
my $dbh = dbh;
$FS::UID::AutoCommit = 0;
@@
-26,17
+26,18
@@
sub usage() {
";
}
";
}
-if (!$opt{s
} or !$opt{e
} or !$opt{r}) {
+if (!$opt{s
tart} or !$opt{end
} or !$opt{r}) {
die usage;
}
print "DRY RUN--changes will not be committed.\n" unless $opt{X};
die usage;
}
print "DRY RUN--changes will not be committed.\n" unless $opt{X};
-my $date = " WHERE _date >= $opt{s} AND _date <= $opt{e}";
-
my %search = ();
$search{payby} = $opt{t} if $opt{t} && $opt{p};
my %search = ();
$search{payby} = $opt{t} if $opt{t} && $opt{p};
+my $date = (keys %search ? ' AND ' : ' WHERE ').
+ " _date >= $opt{start} AND _date <= $opt{end}";
+
my %tables = (
c => 'cust_credit',
p => 'cust_pay',
my %tables = (
c => 'cust_credit',
p => 'cust_pay',