% 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::part_fee - Object methods for part_fee records
use FS::part_fee;
$record = new FS::part_fee \%hash;
$record = new FS::part_fee { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::part_fee object represents the definition of a fee
Fees are like packages, but instead of being ordered and then billed on a cycle, they are created by the operation of events and added to a single invoice. The fee definition specifies the fee's description, how the amount is calculated (a flat fee or a percentage of the customer's balance), and how to classify the fee for tax and reporting purposes.
FS::part_fee inherits from FS::Record. The following fields are currently supported:
Creates a new fee definition. To add the record to the database, see "insert".
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
Delete this record from the database.
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 example. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns a string describing how this fee is calculated.
Given INVOICE (an FS::cust_bill), returns an FS::cust_bill_pkg object representing the invoice line item for the fee, with linked FS::cust_bill_pkg_fee record(s) allocating the fee to the invoice or its line items, as appropriate.
If the fee is going to be charged on the upcoming invoice (credit card processing fees, postal invoice fees), INVOICE should be an uninserted FS::cust_bill object where the 'cust_bill_pkg' property is an arrayref of the non-fee line items that will appear on the invoice.
Returns a customer-viewable description of this fee for the given locale, from the part_fee_msgcat table. If the locale is empty or no localized fee description exists, returns part_fee.itemdesc.
Returns the external taxes (FS::tax_rate objects) that apply to this fee, in the location specified by GEOCODE.
Returns the package category name, or the empty string if there is no package category.