summaryrefslogtreecommitdiff
path: root/httemplate/search/cust_pay.cgi
diff options
context:
space:
mode:
authorivan <ivan>2003-07-14 06:21:29 +0000
committerivan <ivan>2003-07-14 06:21:29 +0000
commitc39eb764e9dc1355b5d085b1fd1660e8cd999841 (patch)
tree85bb0715e1cfc067e9b21d50d4ff56eb19d42ed9 /httemplate/search/cust_pay.cgi
parenta4f114ffbb4684cf1215c92c2015df9fd75677da (diff)
fix bug when both a payment type and date range are specified
Diffstat (limited to 'httemplate/search/cust_pay.cgi')
-rwxr-xr-xhttemplate/search/cust_pay.cgi3
1 files changed, 2 insertions, 1 deletions
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;