diff options
author | Mark Wells <mark@freeside.biz> | 2014-12-12 16:01:48 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-12-12 16:01:48 -0800 |
commit | a1c46091ebd0cc17bcbe19be266dc2efa9f2d92b (patch) | |
tree | 00da82f60e9eeb1b960f071283e72427a5127a93 /FS/FS/Report | |
parent | f48943ca9b3d280919d5e2d4cb6880ea8f095d7b (diff) |
use the mysql equivalent of array_to_string, #32548
Diffstat (limited to 'FS/FS/Report')
-rw-r--r-- | FS/FS/Report/Tax.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/FS/FS/Report/Tax.pm b/FS/FS/Report/Tax.pm index 43337a6..76012fb 100644 --- a/FS/FS/Report/Tax.pm +++ b/FS/FS/Report/Tax.pm @@ -2,7 +2,7 @@ package FS::Report::Tax; use strict; use vars qw($DEBUG); -use FS::Record qw(dbh qsearch qsearchs); +use FS::Record qw(dbh qsearch qsearchs group_concat_sql); use Date::Format qw( time2str ); use Data::Dumper; @@ -113,7 +113,8 @@ sub report_internal { $select .= "NULL AS $_, "; } } - $select .= "array_to_string(array_agg(DISTINCT(cust_main_county.taxnum)), ',') AS taxnums, "; + $select .= group_concat_sql('DISTINCT(cust_main_county.taxnum)', ',') . + ' AS taxnums, '; $group =~ s/, $//; # SELECT/GROUP clauses for second-level (totals) queries @@ -124,7 +125,8 @@ sub report_internal { $select_all = "SELECT $breakdown{pkgclass} AS pkgclass, "; $group_all = "GROUP BY $breakdown{pkgclass}"; } - $select_all .= "array_to_string(array_agg(DISTINCT(cust_main_county.taxnum)), ',') AS taxnums, "; + $select_all .= group_concat_sql('DISTINCT(cust_main_county.taxnum)', ',') . + ' AS taxnums, '; my $agentnum; if ( $opt{agentnum} and $opt{agentnum} =~ /^(\d+)$/ ) { |