diff options
| author | C.J. Adams-Collier <cjac@colliertech.org> | 2014-09-10 17:40:55 -0700 | 
|---|---|---|
| committer | C.J. Adams-Collier <cjac@colliertech.org> | 2014-09-10 17:40:55 -0700 | 
| commit | d87d064dcbc96f948f7ce18b9b36ab839d35e9f5 (patch) | |
| tree | 127c7e0b115decb594ddd4a9101109759eb786b2 /httemplate | |
| parent | 4065dee1d04aa7ebd286a548c22455ce07b85340 (diff) | |
FS RT #884 - merge from master to FREESIDE_3_BRANCH
Diffstat (limited to 'httemplate')
| -rw-r--r-- | httemplate/elements/menu.html | 5 | ||||
| -rw-r--r-- | httemplate/graph/signupdate.cgi | 32 | 
2 files changed, 20 insertions, 17 deletions
| diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 7e329cf23..61cdd746f 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -113,8 +113,9 @@ tie my %report_customers, 'Tie::IxHash';  $report_customers{'List customers'} = [ \%report_customers_lists, 'List customers' ]    if $curuser->access_right('List all customers');  $report_customers{'Zip code distribution'}     = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ]; -$report_customers{'Customer signup report'}       = [ $fsurl. 'graph/report_cust_signup.html', 'New customer signups by date' ], -$report_customers{'Advanced customer reports'} = [ $fsurl. 'search/report_cust_main.html', 'by status, signup date, agent, etc.' ] +$report_customers{'Customer signup report'}    = [ $fsurl. 'graph/report_cust_signup.html',    'New customer signups by date' ]; +$report_customers{'Signup date report'}        = [ $fsurl. 'graph/report_signupdate.html',     'Signup date report (by date of signup)' ]; +$report_customers{'Advanced customer reports'} = [ $fsurl. 'search/report_cust_main.html',     'by status, signup date, agent, etc.' ]    if $curuser->access_right('Advanced customer search');  tie my %report_invoices_open, 'Tie::IxHash', diff --git a/httemplate/graph/signupdate.cgi b/httemplate/graph/signupdate.cgi index 5b7075868..8261257f3 100644 --- a/httemplate/graph/signupdate.cgi +++ b/httemplate/graph/signupdate.cgi @@ -32,22 +32,24 @@ my @count = (0) x 24;  my %where;  $where{'agentnum'} = $agentnum if $agentnum;  $where{'usernum'}   = $usernum if $usernum; -my $sdate = $cgi->param('start_year'). -            '-'. -            $cgi->param('start_month'). -            '-01'; -my $edate = ($cgi->param('end_year') +  -               ($cgi->param('end_month')==12)). -            '-'. -            ($cgi->param('end_month') % 12 + 1). -            '-01'; # first day of the next month - -my $sql = "AND signupdate >= ".str2time($sdate). -          " AND signupdate < ".str2time($edate); - -foreach my $cust (qsearch({ table   => 'cust_main',  + +my $sdate = DateTime->new( +    year       => $cgi->param('start_year'), +    month      => $cgi->param('start_month'), +)->epoch(); + +my $edate = DateTime->new( +    year       => $cgi->param('end_year'), +    month      => $cgi->param('end_month') +)->add( months => 1 )->epoch(); + +my $where = (%where ? ' AND ' : ' WHERE '); +$where .= " signupdate >= $sdate ". +          " AND signupdate < $edate "; + +foreach my $cust (qsearch({ table   => 'cust_main',                              hashref => \%where, -                            extra_sql => $sql } )) { +                            extra_sql => $where } )) {    next if !$cust->signupdate;    my $hour = time2str('%H',$cust->signupdate);    $count[$hour]++; | 
