X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fbulk_void;fp=bin%2Fbulk_void;h=8f0c882a8032a4a6d4f6c406486afc4d96ea5378;hb=922bc346f1c9b1bd68f08d2454f3baac32da734c;hp=b12b5a97238a7e83a0da442132b5d2996a8989a2;hpb=c5a6103898453e530e237e8226411c45b206517e;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',