X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fgraph%2Fsignupdate.cgi;h=8261257f39a5e2e9638ddb2539aa40a48802ad8a;hb=fa0223015fe6c03491b1d0d43524e03ac5fdb899;hp=23e4596649fab113bc84d1f66b599a8d892ff28f;hpb=5f5fbed30812124e5865c4aaf20c927f7d2d01bd;p=freeside.git diff --git a/httemplate/graph/signupdate.cgi b/httemplate/graph/signupdate.cgi index 23e459664..8261257f3 100644 --- a/httemplate/graph/signupdate.cgi +++ b/httemplate/graph/signupdate.cgi @@ -40,13 +40,14 @@ my $sdate = DateTime->new( my $edate = DateTime->new( year => $cgi->param('end_year'), - month => ($cgi->param('end_month') % 12 + 1) # first day of the next month -)->epoch(); + month => $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', +foreach my $cust (qsearch({ table => 'cust_main', hashref => \%where, extra_sql => $where } )) { next if !$cust->signupdate;