X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Fbulk_void;h=8f0c882a8032a4a6d4f6c406486afc4d96ea5378;hb=9270a9fe7ea00f5a24a9ce3b927f932db6650b23;hp=b12b5a97238a7e83a0da442132b5d2996a8989a2;hpb=1f2021c9b76da7cc59e2a981fbac6b24312876d2;p=freeside.git diff --git a/bin/bulk_void b/bin/bulk_void index b12b5a972..8f0c882a8 100755 --- a/bin/bulk_void +++ b/bin/bulk_void @@ -32,11 +32,12 @@ if (!$opt{start} or !$opt{end} or !$opt{r}) { print "DRY RUN--changes will not be committed.\n" unless $opt{X}; -my $date = " WHERE _date >= $opt{start} AND _date <= $opt{end}"; - 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',