Freeside:3:Documentation:Developer/FS/cust main/Search
From Freeside
< Freeside:3:Documentation:Developer | FS | cust main
Revision as of 07:48, 24 March 2015 by Jeremyd (talk | contribs) (Edit via perl MediaWiki framework (1.13))
Contents
NAME
FS::cust_main::Search - Customer searching
SYNOPSIS
use FS::cust_main::Search; FS::cust_main::Search::smart_search(%options); FS::cust_main::Search::email_search(%options); FS::cust_main::Search->search( \%options ); FS::cust_main::Search->fuzzy_search( \%fuzzy_hashref );
SUBROUTINES
- smart_search OPTION => VALUE ...
- Accepts the following options: search, the string to search for. The string will be searched for as a customer number, phone number, name or company name, address (if address1-search is on), invoicing email address, or credit card number.
- Searches match as an exact, or, in some cases, a substring or fuzzy match (see the source code for the exact heuristics used); no_fuzzy_on_exact, causes smart_search to skip fuzzy matching when an exact match is found.
- Any additional options are treated as an additional qualifier on the search (i.e. agentnum).
- Returns a (possibly empty) array of FS::cust_main objects.
- email_search
- Accepts the following options: email, the email address to search for. The email address will be searched for as an email invoice destination and as an svc_acct account.
- Any additional options are treated as an additional qualifier on the search #(i.e. agentnum).
- Returns a (possibly empty) array of FS::cust_main objects (but usually just none or one).
CLASS METHODS
- search HASHREF
- (Class method)
- Returns a qsearch hash expression to search for parameters specified in HASHREF. Valid parameters are
- agentnum
- ; status:; address:; zip:; refnum:; cancelled_pkgs
- bool
- signupdate
- listref of start date, end date
- birthdate
- listref of start date, end date
- spouse_birthdate
- listref of start date, end date
- anniversary_date
- listref of start date, end date
- payby
- listref
- paydate_year
- ; paydate_month:; current_balance
- listref (list returned by FS::UI::Web::parse_lt_gt($cgi, 'current_balance'))
- cust_fields
- ; flattened_pkgs
- bool
- fuzzy_search FUZZY_HASHREF [ OPTS ]
- Performs a fuzzy (approximate) search and returns the matching FS::cust_main records. Currently, first, last, company and/or address1 may be specified.
- Additional options are the same as FS::Record::qsearch
UTILITY SUBROUTINES
- check_and_rebuild_fuzzyfiles; rebuild_fuzzyfiles; append_fuzzyfiles FIRSTNAME LASTNAME COMPANY ADDRESS1; append_fuzzyfiles_fuzzyfield COLUMN VALUE; append_fuzzyfiles_fuzzyfield TABLE.COLUMN VALUE; all_X
BUGS
Bed bugs
SEE ALSO
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
- Around line 1347:
- You forgot a '=back' before '=head1'