diff options
author | Mark Wells <mark@freeside.biz> | 2016-01-27 14:33:41 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-01-27 14:34:11 -0800 |
commit | e3050e0b56e4745cfcf6b9330812ead3e9e2a7bb (patch) | |
tree | 0130155516dbc7c0e787edc0b0423f69f3533094 /httemplate | |
parent | 72b59219418476ef2fa42dac5456d736b76f5810 (diff) |
make location fields available on churn report, #39988
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/search/cust_main_churn.html | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/httemplate/search/cust_main_churn.html b/httemplate/search/cust_main_churn.html index 59f92cb6f..f1ba45016 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'); |