summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main/Search.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index c8a084c9b..cc23f50e0 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -620,6 +620,10 @@ listref (list returned by FS::UI::Web::parse_lt_gt($cgi, 'current_balance'))
bool
+=item select_referral
+
+bool, join to part_referral and select part_referral.referral
+
=back
=cut
@@ -1027,6 +1031,13 @@ sub search {
my(@extra_headers) = ();
my(@extra_fields) = ();
+ if ($params->{'select_referral'}) {
+ $addl_from .= ' LEFT JOIN part_referral ON ( cust_main.refnum = part_referral.refnum ) ';
+ push @select, 'part_referral.referral';
+ push @extra_headers, 'Advertising Source';
+ push @extra_fields, 'referral';
+ }
+
if ($params->{'flattened_pkgs'}) {
#my $pkg_join = '';