summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2005-12-25 03:07:32 +0000
committerivan <ivan>2005-12-25 03:07:32 +0000
commitac6c8883615cd02d768c3222e38b59c3a51b7e7a (patch)
treee6e18d828c7d124a6bce327b6436ffb59feca852
parent58c036fab9ec7f116c5c3f60f20116b433b1930a (diff)
correct "out of taxable region" flag on new line item report - NULLs need to be compared explicitly. apparantly NULL != NULL. bah SQL
-rw-r--r--httemplate/search/cust_bill_pkg.cgi25
1 files changed, 14 insertions, 11 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi
index f84293a..082ccc8 100644
--- a/httemplate/search/cust_bill_pkg.cgi
+++ b/httemplate/search/cust_bill_pkg.cgi
@@ -20,18 +20,21 @@ my $where = "
if ( $cgi->param('out') ) {
$where .= "
- AND 0 = ( SELECT COUNT(*) FROM cust_main_county
- WHERE ( cust_main_county.county = cust_main.county
- OR cust_main_county.county IS NULL AND cust_main.county = ''
- OR cust_main_county.county = '' AND cust_main.county IS NULL
- )
- AND ( cust_main_county.state = cust_main.state
- OR cust_main_county.state IS NULL AND cust_main.state = ''
- OR cust_main_county.state = '' AND cust_main.state IS NULL
- )
- AND cust_main_county.country = cust_main.country
- AND cust_main_county.tax > 0
+ AND 0 = (
+ SELECT COUNT(*) FROM cust_main_county
+ WHERE ( cust_main_county.county = cust_main.county
+ OR ( cust_main_county.county IS NULL AND cust_main.county = '' )
+ OR ( cust_main_county.county = '' AND cust_main.county IS NULL)
+ OR ( cust_main_county.county IS NULL AND cust_main.county IS NULL)
)
+ AND ( cust_main_county.state = cust_main.state
+ OR ( cust_main_county.state IS NULL AND cust_main.state = '' )
+ OR ( cust_main_county.state = '' AND cust_main.state IS NULL )
+ OR ( cust_main_county.state IS NULL AND cust_main.state IS NULL )
+ )
+ AND cust_main_county.country = cust_main.country
+ AND cust_main_county.tax > 0
+ )
";
} elsif ( $cgi->param('country' ) ) {