Revert "RT#41394: Add advertising source to customer fields selection"
authorJonathan Prykop <jonathan@freeside.biz>
Fri, 6 May 2016 04:15:15 +0000 (23:15 -0500)
committerJonathan Prykop <jonathan@freeside.biz>
Fri, 6 May 2016 04:15:15 +0000 (23:15 -0500)
This reverts commit d6e587f3c4c71170a7cc58bf6755d616777bc131.

FS/FS/ConfDefaults.pm
FS/FS/UI/Web.pm
FS/FS/cust_main/Search.pm

index 4c37175..b24a300 100644 (file)
@@ -77,9 +77,6 @@ sub cust_fields_avail { (
   'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | (bill) Latitude | (bill) Longitude | Day phone | Night phone | Mobile phone | Fax number | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | (service) Latitude | (service) Longitude | Invoicing email(s) | Payment Type | Current Balance' =>
     'custnum | Status | Last, First | Company | (address+coord) | (all phones) | (service address+coord) | Invoicing email(s) | Payment Type | Current Balance',
 
-  'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | (bill) Latitude | (bill) Longitude | Day phone | Night phone | Mobile phone | Fax number | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | (service) Latitude | (service) Longitude | Invoicing email(s) | Payment Type | Current Balance | Advertising Source' =>
-    'custnum | Status | Last, First | Company | (address+coord) | (all phones) | (service address+coord) | Invoicing email(s) | Payment Type | Current Balance | Advertising Source',
-
   'Invoicing email(s)' => 'Invoicing email(s)',
   'Cust# | Invoicing email(s)' => 'custnum | Invoicing email(s)',
 
index f460904..8f10011 100644 (file)
@@ -346,7 +346,6 @@ sub cust_header {
     'Payment Type'             => 'cust_payby',
     'Current Balance'          => 'current_balance',
     'Agent Cust#'              => 'agent_custid',
-    'Advertising Source'       => 'referral',
   );
   $header2method{'Cust#'} = 'display_custnum'
     if $conf->exists('cust_main-default_agent_custid');
@@ -456,9 +455,6 @@ sub cust_sql_fields {
     push @extra_fields, FS::cust_main->balance_sql . " AS current_balance";
   }
 
-  push @extra_fields, 'part_referral.referral AS referral'
-    if grep { $_ eq 'referral' } @cust_fields;
-
   map("cust_main.$_", @fields), @location_fields, @extra_fields;
 }
 
@@ -523,10 +519,6 @@ sub join_cust_main {
             " ON (ship_location.locationnum = $location_table.$locationnum) ";
   }
 
-  if ( !@cust_fields or grep { $_ eq 'referral' } @cust_fields ) {
-    $sql .= ' LEFT JOIN part_referral ON (cust_main.refnum = part_referral.refnum) ';
-  }
-
   $sql;
 }
 
index 8e6d185..c8a084c 100644 (file)
@@ -1013,10 +1013,6 @@ 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 = (