Freeside:3:Documentation:Developer/FS/cust main county
From Freeside
< Freeside:3:Documentation:Developer | FS
Revision as of 20:04, 27 June 2012 by Ivan (talk | contribs) (Edit via perl MediaWiki framework (1.13))
NAME
FS::cust_main_county - Object methods for cust_main_county objects
SYNOPSIS
use FS::cust_main_county; $record = new FS::cust_main_county \%hash; $record = new FS::cust_main_county { 'column' => 'value' }; $error = $record->insert; $error = $new_record->replace($old_record); $error = $record->delete; $error = $record->check; ($county_html, $state_html, $country_html) = FS::cust_main_county::regionselector( $county, $state, $country );
DESCRIPTION
An FS::cust_main_county object represents a tax rate, defined by locale. FS::cust_main_county inherits from FS::Record. The following fields are currently supported:
- taxnum - primary key (assigned automatically for new tax rates); district - tax district (optional); city; county; state; country; tax - percentage; taxclass; exempt_amount; taxname - if defined, printed on invoices instead of "Tax"; setuptax - if 'Y', this tax does not apply to setup fees; recurtax - if 'Y', this tax does not apply to recurring fees
METHODS
- new HASHREF
- Creates a new tax rate. To add the tax rate to the database, see "insert".
- insert
- Adds this tax rate to the database. If there is an error, returns the error, otherwise returns false.
- delete
- Deletes this tax rate from the database. If there is an error, returns the error, otherwise returns false.
- replace OLD_RECORD
- Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
- check
- Checks all fields to make sure this is a valid tax rate. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
- sql_taxclass_sameregion
- Returns an SQL WHERE fragment or the empty string to search for entries with different tax classes.
- taxline TAXABLES_ARRAYREF, [ OPTION => VALUE ... ]
- Returns a listref of a name and an amount of tax calculated for the list of packages or amounts referenced by TAXABLES_ARRAYREF. Returns a scalar error message on error.
- Options include custnum and invoice_date and are hints to this method
SUBROUTINES
- regionselector [ COUNTY STATE COUNTRY [ PREFIX [ ONCHANGE [ DISABLED ] ] ] ]
BUGS
regionselector? putting web ui components in here? they should probably live somewhere else...
SEE ALSO
FS::Record, FS::cust_main, FS::cust_bill, schema.html from the base documentation.