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
##
#scalars
my @scalars = qw (
agentnum status address zip 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
);
% }
<TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('With email address(es)') |h %></TD>
+ <TD><INPUT TYPE="checkbox" NAME="with_email"></TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Without postal mail invoices') |h %></TD>
+ <TD><INPUT TYPE="checkbox" NAME="no_POST"></TD>
+ </TR>
+
+ <TR>
<TH CLASS="background" COLSPAN=2> </TH>
</TR>