[freeside-commits] branch master updated. e3050e0b56e4745cfcf6b9330812ead3e9e2a7bb

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


The branch, master has been updated
       via  e3050e0b56e4745cfcf6b9330812ead3e9e2a7bb (commit)
      from  72b59219418476ef2fa42dac5456d736b76f5810 (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 e3050e0b56e4745cfcf6b9330812ead3e9e2a7bb
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 100644
--- 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