summaryrefslogtreecommitdiff
path: root/httemplate/search/report_tax.cgi
diff options
context:
space:
mode:
authorivan <ivan>2007-10-29 10:30:53 +0000
committerivan <ivan>2007-10-29 10:30:53 +0000
commitb91bcdff200acb281c58c4ba5ef8482b335ecdbc (patch)
tree76767f260e8babb87d7498638c0cce02c39339b3 /httemplate/search/report_tax.cgi
parent9595e16b22b67dda69322cacbe69d518ae3db4cc (diff)
mysql has no DISTINCT ON either, sigh
Diffstat (limited to 'httemplate/search/report_tax.cgi')
-rwxr-xr-xhttemplate/search/report_tax.cgi15
1 files changed, 14 insertions, 1 deletions
diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi
index bb9c8f433..eddb3da00 100755
--- a/httemplate/search/report_tax.cgi
+++ b/httemplate/search/report_tax.cgi
@@ -444,7 +444,20 @@ my %base_regions = ();
foreach my $r (
qsearch( 'cust_main_county',
{},
- "DISTINCT ON ( country, state, county, CASE WHEN taxname IS NULL THEN '' ELSE taxname END ) *",
+ "DISTINCT
+ country,
+ state,
+ county,
+ CASE WHEN taxname IS NULL THEN '' ELSE taxname END AS taxname,".
+
+ #a little bit unsure of this part... test?
+ #ah, it looks like it winds up being irrelevant as ->{'tax'}
+ # from $regions is not displayed when show_taxclasses is on
+ ( $cgi->param('show_taxclasses')
+ ? " CASE WHEN taxclass IS NULL THEN '' ELSE taxclass END "
+ : " '' "
+ )." AS taxclass"
+ ,
$gotcust
)
) {