##
# with referrals
##
- if ( $params->{'with_referrals'} ) {
+ if ( $params->{'with_referrals'} =~ /^\s*(\d+)\s*$/ ) {
push @where,
- ' EXISTS ( SELECT 1 FROM cust_main AS referred_cust_main
- WHERE cust_main.custnum = referred_cust_main.referral_custnum )';
+ " $1 <= ( SELECT COUNT(*) FROM cust_main AS referred_cust_main
+ WHERE cust_main.custnum = referred_cust_main.referral_custnum )";
}
##
<TH ALIGN="right" VALIGN="center"><% mt('Search historical addresses') %></TH>
<TD><INPUT TYPE="checkbox" NAME="location_history" VALUE="1"></TD>
+ <& /elements/tr-input-text.html,
+ label => emt('At least this many referrals'),
+ field => 'with_referrals',
+ size => 4,
+ maxlength => 4,
+ &>
+
</TABLE>
<BR>