[freeside-commits] branch master updated. 2f16e6d6e40950637f714d2fdebfd44db1cf8db7

Carl J. Adams-Collier cjac at 420.am
Wed Sep 3 14:44:15 PDT 2014


The branch, master has been updated
       via  2f16e6d6e40950637f714d2fdebfd44db1cf8db7 (commit)
      from  b57377d091b08fe8874d362d885361cc8380ca69 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2f16e6d6e40950637f714d2fdebfd44db1cf8db7
Author: C.J. Adams-Collier <cjac at colliertech.org>
Date:   Wed Sep 3 12:21:43 2014 -0700

    FS RT ticket #884

diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index aabee65..580c8de 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{'Sign-up Date report'}       = [ $fsurl. 'graph/report_signupdate.html',     'Sign-up Date report (by date of sign-up)' ];
+$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 5b70758..43deddc 100644
--- a/httemplate/graph/signupdate.cgi
+++ b/httemplate/graph/signupdate.cgi
@@ -32,22 +32,25 @@ 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);
+
+my $sdate = DateTime->new(
+    year       => $cgi->param('start_year'),
+    month      => $cgi->param('start_month'),
+    time_zone  => 'America/Los_Angeles',
+)->epoch();
+
+my $edate = DateTime->new(
+    year       => $cgi->param('end_year'),
+    month      => $cgi->param('end_month'),
+    time_zone  => 'America/Los_Angeles',
+)->epoch();
+
+my $where .= " AND 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]++;

-----------------------------------------------------------------------

Summary of changes:
 httemplate/elements/menu.html   |    5 +++--
 httemplate/graph/signupdate.cgi |   29 ++++++++++++++++-------------
 2 files changed, 19 insertions(+), 15 deletions(-)




More information about the freeside-commits mailing list