Difference between revisions of "Freeside:4:Documentation:Developer/FS/geocode Mixin"
From Freeside
(Edit via perl MediaWiki framework (1.13)) |
(No difference)
|
Latest revision as of 07:22, 18 November 2015
Contents
NAME
FS::geocode_Mixin - Mixin class for records that contain address and other location fields.
SYNOPSIS
package FS::some_table; use base ( FS::geocode_Mixin FS::Record );
DESCRIPTION
FS::geocode_Mixin - This is a mixin class for records that contain address and other location fields.
METHODS
- location_hash
- 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
- join_string
- used to separate the address elements (defaults to ', ')
- escape_function
- 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.
BUGS
SEE ALSO
FS::Record, schema.html from the base documentation.