<% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>

FS::geocode_Mixin

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

country_full

Returns the full country name.

set_coord

Look up the coordinates of the location using (currently) the Google Maps API and set the 'latitude' and 'longitude' fields accordingly.

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.

<% include ('/elements/footer.html' ) %>