summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm2
-rw-r--r--FS/FS/ConfDefaults.pm12
-rw-r--r--FS/FS/cust_main/Search.pm18
3 files changed, 23 insertions, 9 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 980bd628a..b1f003b54 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2477,7 +2477,7 @@ and customer address. Include units.',
{
'key' => 'address1-search',
'section' => 'UI',
- 'description' => 'Enable the ability to search the address1 field from customer search.',
+ 'description' => 'Enable the ability to search the address1 field from the quick customer search. Not recommended in most cases as it tends to bring up too many search results - use explicit address searching from the advanced customer search instead.',
'type' => 'checkbox',
},
diff --git a/FS/FS/ConfDefaults.pm b/FS/FS/ConfDefaults.pm
index 12c82e69c..de65b44a9 100644
--- a/FS/FS/ConfDefaults.pm
+++ b/FS/FS/ConfDefaults.pm
@@ -49,22 +49,22 @@ sub cust_fields_avail { (
'custnum | Status | Last, First | Company | (same for service contact if present)',
'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Invoicing email(s)' =>
- 'custnum | Status | Last, First | Company | (all address fields) | Day phone | Night phone | Invoicing email(s)',
+ 'custnum | Status | Last, First | Company | (address) | Day phone | Night phone | Invoicing email(s)',
'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Fax number | Invoicing email(s) | Payment Type' =>
- 'custnum | Status | Last, First | Company | (all address fields) | (all phones) | Invoicing email(s) | Payment Type',
+ 'custnum | Status | Last, First | Company | (address) | (all phones) | Invoicing email(s) | Payment Type',
'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Fax number | Invoicing email(s) | Payment Type | Current Balance' =>
- 'custnum | Status | Last, First | Company | (all address fields) | (all phones) | Invoicing email(s) | Payment Type | Current Balance',
+ 'custnum | Status | Last, First | Company | (address) | (all phones) | Invoicing email(s) | Payment Type | Current Balance',
'Cust# | Cust. Status | (bill) Name | (bill) Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | (bill) Day phone | (bill) Night phone | (service) Name | (service) Company | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | (service) Day phone | (service) Night phone | Invoicing email(s)' =>
- 'custnum | Status | Last, First | Company | (all address fields) | Day phone | Night phone | (service address) | Invoicing email(s)',
+ 'custnum | Status | Last, First | Company | (address) | Day phone | Night phone | (service address) | Invoicing email(s)',
'Cust# | Cust. Status | (bill) Name | (bill) Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | (bill) Day phone | (bill) Night phone | (bill) Fax number | (service) Name | (service) Company | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | (service) Day phone | (service) Night phone | (service) Fax number | Invoicing email(s) | Payment Type' =>
- 'custnum | Status | Last, First | Company | (all address fields) | (all phones) | (service address) | Invoicing email(s) | Payment Type',
+ 'custnum | Status | Last, First | Company | (address) | (all phones) | (service address) | Invoicing email(s) | Payment Type',
'Cust# | Cust. Status | (bill) Name | (bill) Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | (bill) Day phone | (bill) Night phone | (bill) Fax number | (service) Name | (service) Company | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | (service) Day phone | (service) Night phone | (service) Fax number | Invoicing email(s) | Payment Type | Current Balance' =>
- 'custnum | Status | Last, First | Company | (all address fields) | (all phones) | (service address) | Invoicing email(s) | Payment Type | Current Balance',
+ 'custnum | Status | Last, First | Company | (address) | (all phones) | (service address) | Invoicing email(s) | Payment Type | Current Balance',
'Invoicing email(s)' => 'Invoicing email(s)',
'Cust# | Invoicing email(s)' => 'custnum | Invoicing email(s)',
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 3813f891a..a87928f6a 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -203,7 +203,7 @@ sub smart_search {
} elsif ( ! $NameParse->parse($value) ) {
my %name = $NameParse->components;
- $first = $name{'given_name_1'};
+ $first = $name{'given_name_1'} || $name{'initials_1'}; #wtf NameParse, Ed?
$last = $name{'surname_1'};
}
@@ -422,6 +422,8 @@ HASHREF. Valid parameters are
=item status
+=item address
+
=item cancelled_pkgs
bool
@@ -488,7 +490,19 @@ sub search {
#push @where, $class->$method();
push @where, FS::cust_main->$method();
}
-
+
+ ##
+ # address
+ ##
+ if ( $params->{'address'} =~ /\S/ ) {
+ my $address = dbh->quote('%'. lc($params->{'address'}). '%');
+ push @where, '('. join(' OR ',
+ map "LOWER($_) LIKE $address",
+ qw(address1 address2 ship_address1 ship_address2)
+ ).
+ ')';
+ }
+
##
# parse cancelled package checkbox
##