X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fgraph%2Fsignupdate.cgi;h=823ddb89f27b4e2aefea752538ffd71529b45bb9;hb=081638aa4a483577a9c5bc7ac9ea518370cf2381;hp=011817c3a96ae5e0bd4fe24c81f04fd5e51e7d16;hpb=f3145308f69d7d3d42af6132439cff26b4fc9008;p=freeside.git diff --git a/httemplate/graph/signupdate.cgi b/httemplate/graph/signupdate.cgi index 011817c3a..823ddb89f 100644 --- a/httemplate/graph/signupdate.cgi +++ b/httemplate/graph/signupdate.cgi @@ -34,17 +34,18 @@ $where{'agentnum'} = $agentnum if $agentnum; $where{'usernum'} = $usernum if $usernum; my $sdate = DateTime->new( - year => $cgi->param('start_year'), - month => $cgi->param('start_month'), + year => scalar($cgi->param('start_year')), + month => scalar($cgi->param('start_month')), )->epoch(); my $edate = DateTime->new( - year => $cgi->param('end_year'), - month => $cgi->param('end_month') + year => scalar($cgi->param('end_year')), + month => scalar($cgi->param('end_month')), )->add( months => 1 )->epoch(); -my $where .= " AND signupdate >= $sdate ". - " AND signupdate < $edate "; +my $where = (%where ? ' AND ' : ' WHERE '); +$where .= " signupdate >= $sdate ". + " AND signupdate < $edate "; foreach my $cust (qsearch({ table => 'cust_main', hashref => \%where,