diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-09-01 17:00:22 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-09-01 17:00:22 -0700 |
commit | ddb601f6bb7bdce8e0912e78472335f5613d20db (patch) | |
tree | c332e0d18be5f14e1cfb8c42ccd2a46122e3b163 /httemplate/search/sqlradius_usage.html | |
parent | 4a896c6c3703b5f509fc75e98a7982fbcd85f9ae (diff) | |
parent | f33281a9f445b06e319c45f393c71577701eff67 (diff) |
Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH
Diffstat (limited to 'httemplate/search/sqlradius_usage.html')
-rw-r--r-- | httemplate/search/sqlradius_usage.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/httemplate/search/sqlradius_usage.html b/httemplate/search/sqlradius_usage.html index fcf6c100e..561476e0b 100644 --- a/httemplate/search/sqlradius_usage.html +++ b/httemplate/search/sqlradius_usage.html @@ -39,6 +39,7 @@ @svc_fields, @svc_usage, ], + 'order_by_sql' => $order_by_sql, 'links' => [ #( map { $_ ne 'Cust. Status' ? $link_cust : '' } # FS::UI::Web::cust_header() ), $link_cust, @@ -256,4 +257,24 @@ sub bytes_to_gb { $_[0] ? sprintf('%.3f', $_[0] / (1024*1024*1024.0)) : ''; } + +my $conf = new FS::Conf; +my $order_by_sql = { + 'name' => "CASE WHEN cust_main.company IS NOT NULL + AND cust_main.company != '' + THEN CONCAT(cust_main.company,' (',cust_main.last,', ',cust_main.first,')') + ELSE CONCAT(cust_main.last,', ',cust_main.first) + END", + 'display_custnum' => $conf->exists('cust_main-default_agent_custid') + ? "CASE WHEN cust_main.agent_custid IS NOT NULL + AND cust_main.agent_custid != '' + AND cust_main.agent_custid ". regexp_sql. " '^[0-9]+\$' + THEN CAST(cust_main.agent_custid AS BIGINT) + ELSE cust_main.custnum + END" + : "custnum", +}; + +#warn Dumper \%usage_by_username; + </%init> |