From b3adce5416b0342d664a84d75fe51d272f841d8e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 19 Sep 2007 00:12:08 +0000 Subject: 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 --- FS/FS/cust_bill.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'FS') diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index d31276d35..ace853356 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2600,6 +2600,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"; } @@ -2623,7 +2629,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', -- cgit v1.2.1