[freeside-commits] branch FREESIDE_3_BRANCH updated. cc0b50aa2d0952e3fe06c9a44c6637ad2fcb5588

Mark Wells mark at 420.am
Wed Jan 27 14:40:01 PST 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  cc0b50aa2d0952e3fe06c9a44c6637ad2fcb5588 (commit)
      from  08e9b7ea8e912dfa70de6d08eb7849d3bd9c68b5 (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 cc0b50aa2d0952e3fe06c9a44c6637ad2fcb5588
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Jan 27 14:33:41 2016 -0800

    make location fields available on churn report, #39988

diff --git a/httemplate/search/cust_main_churn.html b/httemplate/search/cust_main_churn.html
index 59f92cb..f1ba450 100755
--- a/httemplate/search/cust_main_churn.html
+++ b/httemplate/search/cust_main_churn.html
@@ -33,6 +33,16 @@
     'e_suspended',
     'e_cancelled',
   ],
+  'sort_fields' => [
+    'custnum',
+    FS::UI::Web::cust_sql_fields,
+    's_active',
+    's_suspended',
+    's_cancelled',
+    'e_active',
+    'e_suspended',
+    'e_cancelled',
+  ],
   'color' => [
     '',
     FS::UI::Web::cust_colors(),
@@ -77,13 +87,20 @@ if ($cgi->param('agentnum') =~ /^(\d+)$/) {
 
 # can't use this directly as it doesn't have any cust_main fields.
 my $churn = FS::cust_main::Status->churn_sql($speriod, $eperiod);
+my $select = join(',',
+  'churn.*',
+  'cust_main.*',
+  FS::UI::Web::cust_sql_fields()
+);
 
+my $addl_from = " JOIN ($churn) AS churn USING (custnum) ".
+                FS::UI::Web::join_cust_main('cust_main.custnum') ;
 my $query = {
   'table'     => 'cust_main',
-  'select'    => 'cust_main.*, churn.*',
-  'addl_from' => " JOIN ($churn) AS churn USING (custnum) ",
+  'select'    => $select,
+  'addl_from' => $addl_from,
 };
-my $count_query = "SELECT COUNT(*) FROM cust_main JOIN ($churn) AS churn USING (custnum)";
+my $count_query = "SELECT COUNT(*) FROM cust_main $addl_from";
 my @where;
 
 my $status = $cgi->param('status');

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

Summary of changes:
 httemplate/search/cust_main_churn.html |   23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list