diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2016-11-16 09:38:55 -0800 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2016-11-16 09:38:55 -0800 |
| commit | d8ab24b3869cd8402e20f49456b0c24bc110cb1b (patch) | |
| tree | ee11c9e248fd3b6576afb3753eaf838e54c931c3 | |
| parent | 4cc5534c6ef248937db2909b2e80c91a883d33e2 (diff) | |
add -t flag to bulk void for payment type, RT#73413
| -rwxr-xr-x | bin/bulk_void | 5 |
1 files changed, 3 insertions, 2 deletions
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', |
