X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_pkg_summary.cgi;h=76ca8956b804e1c9ed326a90f6365a979744dd6a;hp=c0eb6992006921c42de40ef67bd85f6a9d3ff1a3;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hpb=a6dd5bc6ba6c655b1707a016db4e97e269b718e5 diff --git a/httemplate/search/cust_pkg_summary.cgi b/httemplate/search/cust_pkg_summary.cgi index c0eb69920..76ca8956b 100644 --- a/httemplate/search/cust_pkg_summary.cgi +++ b/httemplate/search/cust_pkg_summary.cgi @@ -56,7 +56,8 @@ foreach my $column (keys %conds) { my $count_query = $h_search->{count_query}; # push a select expression for the total packages with pkgpart=main.pkgpart - push @select, "($count_query AND h_cust_pkg.pkgpart = main.pkgpart) AS $column"; + # (have to quote $column, otherwise mysql thinks before/after are keywords) + push @select, "($count_query AND h_cust_pkg.pkgpart = main.pkgpart) AS \"$column\""; # and query the total packages with pkgpart=any of the main.pkgparts my $total = FS::Record->scalar_sql($count_query .