diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-12-20 01:51:24 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-12-20 01:51:24 -0800 |
commit | 2ee09c1343daa939da146c102dbca72f0a98d2bf (patch) | |
tree | e6a68a0acb76672bc65a1e8e29666a007a32de4f /FS/FS/cust_main | |
parent | 578ec27f71498b63102e4cca204575c01c1f8fa9 (diff) |
add "with email address(es)" and "without postal mail invoices" to adv. customer search, RT#20708
Diffstat (limited to 'FS/FS/cust_main')
-rw-r--r-- | FS/FS/cust_main/Search.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index b07223ec5..1047890c3 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -633,6 +633,27 @@ sub search { if $params->{'with_geocode'}; ## + # "with email address(es)" checkbox + ## + + push @where, + 'EXISTS ( SELECT 1 FROM cust_main_invoice + WHERE cust_main_invoice.custnum = cust_main.custnum + AND length(dest) > 5 + )' # AND dest LIKE '%@%' + if $params->{'with_email'}; + + ## + # "without postal mail invoices" checkbox + ## + + push @where, + "NOT EXISTS ( SELECT 1 FROM cust_main_invoice + WHERE cust_main_invoice.custnum = cust_main.custnum + AND dest = 'POST' )" + if $params->{'no_POST'}; + + ## # dates ## |