diff options
author | ivan <ivan> | 2007-09-19 00:12:05 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-09-19 00:12:05 +0000 |
commit | ed722b852f9f24a023bd1f1aa4a16ec39230e22c (patch) | |
tree | e7e2a8c8d6cdcb353234b143f0cd26de45c9e843 /FS | |
parent | 3360d7ada7ed391b744b7205ad632f2c42d323f6 (diff) |
fix at least one small problem with reprint/email/fax functionality: now should understand the "most recent invoice per customer" and invoice # min/max options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_bill.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index f6dbc3df0..b9c0b5fb4 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2693,6 +2693,12 @@ sub re_X { if ( $param{'end'} =~ /^(\d+)$/ ) { push @where, "cust_bill._date < $1"; } + if ( $param{'invnum_min'} =~ /^(\d+)$/ ) { + push @where, "cust_bill.invnum >= $1"; + } + if ( $param{'invnum_max'} =~ /^(\d+)$/ ) { + push @where, "cust_bill.invnum <= $1"; + } if ( $param{'agentnum'} =~ /^(\d+)$/ ) { push @where, "cust_main.agentnum = $1"; } @@ -2716,7 +2722,6 @@ sub re_X { if ( $param{'newest_percust'} ) { $distinct = 'DISTINCT ON ( cust_bill.custnum )'; $orderby = 'ORDER BY cust_bill.custnum ASC, cust_bill._date DESC'; - #$count_query = "SELECT COUNT(DISTINCT cust_bill.custnum), 'N/A', 'N/A'"; } my @cust_bill = qsearch( 'cust_bill', |