summaryrefslogtreecommitdiff
path: root/httemplate/search/477partIIB.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/search/477partIIB.html')
-rwxr-xr-xhttemplate/search/477partIIB.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/httemplate/search/477partIIB.html b/httemplate/search/477partIIB.html
index 86f75f3..94aa818 100755
--- a/httemplate/search/477partIIB.html
+++ b/httemplate/search/477partIIB.html
@@ -47,10 +47,10 @@ my $column_value = sub {
my $count_sql = delete($sql_query->{'count_query'});
if ( $row == 2 ) {
- $count_sql =~ s/COUNT\(\*\) FROM/COALESCE( sum(CASE WHEN cust_main.company IS NULL OR cust_main.company = '' THEN fcc_ds0s END), 0 ) FROM/
+ $count_sql =~ s/COUNT\(\*\) FROM/sum(COALESCE(CASE WHEN cust_main.company IS NULL OR cust_main.company = '' THEN CASE WHEN part_pkg.fcc_ds0s IS NOT NULL AND part_pkg.fcc_ds0s > 0 THEN part_pkg.fcc_ds0s WHEN pkg_class.fcc_ds0s IS NOT NULL AND pkg_class.fcc_ds0s > 0 THEN pkg_class.fcc_ds0s ELSE 0 END ELSE 0 END, 0) ) FROM/
or die "couldn't parse count_sql";
} else {
- $count_sql =~ s/COUNT\(\*\) FROM/COALESCE( sum(fcc_ds0s), 0 ) FROM/
+ $count_sql =~ s/COUNT\(\*\) FROM/sum(COALESCE(CASE WHEN part_pkg.fcc_ds0s IS NOT NULL AND part_pkg.fcc_ds0s > 0 THEN part_pkg.fcc_ds0s WHEN pkg_class.fcc_ds0s IS NOT NULL AND pkg_class.fcc_ds0s > 0 THEN pkg_class.fcc_ds0s ELSE 0 END, 0)) FROM/
or die "couldn't parse count_sql";
}