From: ivan Date: Mon, 14 Jul 2003 06:21:30 +0000 (+0000) Subject: fix bug when both a payment type and date range are specified X-Git-Tag: freeside_1_4_1rc5~4 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=bc78fff57f36e24b87df3202e9529c498e4a0389;p=freeside.git fix bug when both a payment type and date range are specified --- diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi index d601617f9..7a983703f 100755 --- a/httemplate/search/cust_pay.cgi +++ b/httemplate/search/cust_pay.cgi @@ -23,8 +23,9 @@ if ( $cgi->param('magic') && $cgi->param('magic') eq '_date' ) { my $ending = str2time($1) + 86400; $range .= ( $range ? ' AND ' : ' WHERE ' ). " _date <= $ending "; } + $range =~ s/^\s*WHERE/ AND/ if scalar(keys %search) ; - @cust_pay = qsearch('cust_pay', \%search, '', " $range" ); + @cust_pay = qsearch('cust_pay', \%search, '', $range ); $sortby = \*date_sort;