Difference between revisions of "Freeside:3:Documentation:Developer/FS/Misc/Geo"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
 
m (Edit via perl MediaWiki framework (1.13))
Line 2: Line 2:
 
FS::Misc::Geo - routines to fetch geographic information
 
FS::Misc::Geo - routines to fetch geographic information
  
==FUNCTIONS==
+
==CLASS METHODS==
 
; get_censustract LOCATION YEAR
 
; get_censustract LOCATION YEAR
 
:Given a location hash (see [[Freeside:3:Documentation:Developer/FS/location Mixin|FS::location_Mixin]]) and a census map year, returns a census tract code (consisting of state, county, and tract codes) or an error message.
 
:Given a location hash (see [[Freeside:3:Documentation:Developer/FS/location Mixin|FS::location_Mixin]]) and a census map year, returns a census tract code (consisting of state, county, and tract codes) or an error message.
Line 15: Line 15:
  
 
:get_district will die on error.
 
:get_district will die on error.
 +
 +
::Given 'address1' and 'address2' strings, extract the sublocation part (from either one) and return it. If the sublocation was found in ADDRESS1, also return ADDRESS2 (cleaned up for postal standards) as it's assumed to contain something relevant.
 +
 +
==POD ERRORS==
 +
Hey! '''The above document had some coding errors, which are explained below:'''
 +
 +
; Around line 524:
 +
:Unknown directive: =iten

Revision as of 14:42, 27 June 2014

NAME

FS::Misc::Geo - routines to fetch geographic information

CLASS METHODS

get_censustract LOCATION YEAR
Given a location hash (see FS::location_Mixin) and a census map year, returns a census tract code (consisting of state, county, and tract codes) or an error message.
get_district LOCATION METHOD
For the location hash in LOCATION, using lookup method METHOD, fetch tax district information. Currently the only available method is 'wa_sales' (the Washington Department of Revenue sales tax lookup).
Returns a hash reference containing the following fields:
- district - tax (percentage) - taxname - exempt_amount (currently zero) - city, county, state, country (from
The intent is that you can assign this to an FS::cust_main_county object and insert it if there's not yet a tax rate defined for that district.
get_district will die on error.
Given 'address1' and 'address2' strings, extract the sublocation part (from either one) and return it. If the sublocation was found in ADDRESS1, also return ADDRESS2 (cleaned up for postal standards) as it's assumed to contain something relevant.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 524:
Unknown directive: =iten