% 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::cust_main_county - Object methods for cust_main_county objects
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 );
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:
Creates a new tax rate. To add the tax rate to the database, see "insert".
Adds this tax rate to the database. If there is an error, returns the error, otherwise returns false.
Deletes this tax rate from the database. If there is an error, returns the error, otherwise returns false.
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
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.
Returns a label looking like "Anytown, Alameda County, CA, US".
If the taxname field is set, it will look like "CA Sales Tax (Anytown, Alameda County, CA, US)".
If the taxclass is set, then it will be "Anytown, Alameda County, CA, US (International)".
OPTIONS may contain "with_taxclass", "with_city", and "with_district" to show those fields. It may also contain "out", in which case, if this region (district+city+county+state+country) contains no non-zero taxes, the label will read "Out of taxable region(s)".
Returns an SQL WHERE fragment or the empty string to search for entries with different tax classes.
Takes an arrayref of FS::cust_bill_pkg objects representing taxable line items, and returns a new FS::cust_bill_pkg object representing the tax on them under this tax rate.
This will have a pseudo-field, "cust_bill_pkg_tax_location", containing an arrayref of FS::cust_bill_pkg_tax_location objects. Each of these will in turn have a "taxable_cust_bill_pkg" pseudo-field linking it to one of the taxable items. All of these links must be resolved as the objects are inserted.
Options may include 'custnum' and 'invoice_time' in case the cust_bill_pkg objects belong to an invoice that hasn't been inserted yet.
Options may include 'exemptions', an arrayref of FS::cust_tax_exempt_pkg objects belonging to the same customer, to be counted against the monthly tax exemption limit if there is one.
regionselector? putting web ui components in here? they should probably live somewhere else...
FS::Record, FS::cust_main, FS::cust_bill, schema.html from the base documentation.