##
# 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 )";
}
##
</TD>
</TR>
+ <& /elements/tr-input-text.html,
+ label => emt('At least this many referrals'),
+ field => 'with_referrals',
+ size => 4,
+ maxlength => 4,
+ &>
+
</TABLE>
<BR>