X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FSearch.pm;h=e9a42935d405648f270a9664cb76a189bf1c50bb;hp=a8f9791ef8842b58c3b1923f265a574b11eea090;hb=9f80fd85a1bbe4edeb075fc364da2a03edd294af;hpb=2ec92076c7dae5648da28e510efa1f733da9fd76 diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index a8f9791ef..e9a42935d 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -1059,6 +1059,10 @@ sub search { 'ON (cust_main.'.$pre.'locationnum = '.$pre.'location.locationnum) '; } + # always make referral available in results + # (maybe we should be using FS::UI::Web::join_cust_main instead?) + $addl_from .= ' LEFT JOIN part_referral ON (cust_main.refnum = part_referral.refnum) '; + my $count_query = "SELECT COUNT(*) FROM cust_main $addl_from $extra_sql"; my @select = (