< Freeside:4:Documentation:Developer | FS
Revision as of 08:22, 18 November 2015 by Jeremyd (Edit via perl MediaWiki framework (1.13))
FS::geocode_Mixin - Mixin class for records that contain address and other location fields.
package FS::some_table; use base ( FS::geocode_Mixin FS::Record );
FS::geocode_Mixin - This is a mixin class for records that contain address and other location fields.
- Returns a list of key/value pairs, with the following keys: address1, address2, city, county, state, zip, country, geocode, location_type, location_number, location_kind. The shipping address is used if present.
- location_label [ OPTION => VALUE ... ]
- Returns the label of the service location (see analog in FS::cust_location) for this customer.
- Options are
- used to separate the address elements (defaults to ', ')
- a callback used for escaping the text of the address elements
- set_coord [ PREFIX ]
- Look up the coordinates of the location using (currently) the Google Maps API and set the 'latitude' and 'longitude' fields accordingly.
- PREFIX, if specified, will be prepended to all location field names, including latitude and longitude.
- geocode DATA_VENDOR
- Returns a value for the customer location as encoded by DATA_VENDOR. Currently this only makes sense for "CCH" as DATA_VENDOR.
- process_district_update CLASS ID
- Queueable function to update the tax district code using the selected method (config 'tax_district_method'). CLASS is either 'FS::cust_main' or 'FS::cust_location'; ID is the key in one of those tables.
FS::Record, schema.html from the base documentation.