From: Ivan Kohler Date: Thu, 20 Dec 2012 09:51:32 +0000 (-0800) Subject: add "with email address(es)" and "without postal mail invoices" to adv. customer... X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=ddc6218aa921664c4a3baa7e0daa81b6fbeaa658;p=freeside.git add "with email address(es)" and "without postal mail invoices" to adv. customer search, RT#20708 --- diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index a6eb0a54d..fb516ee39 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -618,6 +618,27 @@ sub search { push @where, "geocode is not null" 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 ## diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index f75b45197..645c81e69 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -42,7 +42,8 @@ my %search_hash = (); #scalars my @scalars = qw ( agentnum status address paydate_year paydate_month invoice_terms - no_censustract with_geocode custbatch usernum + no_censustract with_geocode with_email no_POST + custbatch usernum cancelled_pkgs cust_fields flattened_pkgs ); diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html index 4fb8fecfb..5cf85ad64 100755 --- a/httemplate/search/report_cust_main.html +++ b/httemplate/search/report_cust_main.html @@ -163,6 +163,16 @@ % } + + <% mt('With email address(es)') |h %> + + + + + <% mt('Without postal mail invoices') |h %> + + +