Freeside:4:Documentation:Developer/FS/FeeOrigin Mixin
From Freeside
< Freeside:4:Documentation:Developer | FS
Revision as of 07:22, 18 November 2015 by Jeremyd (talk | contribs) (Edit via perl MediaWiki framework (1.13))
NAME
FS::FeeOrigin_Mixin - Common interface for fee origin records
SYNOPSIS
use FS::cust_event_fee; $record = new FS::cust_event_fee \%hash; $record = new FS::cust_event_fee { 'column' => 'value' }; $error = $record->insert; $error = $new_record->replace($old_record); $error = $record->delete; $error = $record->check;
DESCRIPTION
An FS::FeeOrigin_Mixin object associates the timestamped event that triggered a fee (which may be a billing event, or something else like a package suspension) to the resulting invoice line item (FS::cust_bill_pkg object). The following fields are required:
- billpkgnum - key of the cust_bill_pkg record representing the fee on an invoice. This is a unique column but can be NULL to indicate a fee that hasn't been billed yet. In that case it will be billed the next time billing runs for the customer.; feepart - key of the fee definition (FS::part_fee).; nextbill - 'Y' if the fee should be charged on the customer's next bill, rather than causing a bill to be produced immediately.
CLASS METHODS
- by_cust CUSTNUM[, PARAMS]
- Finds all cust_event_fee records belonging to the customer CUSTNUM.
- PARAMS can be additional params to pass to qsearch; this really only works for 'hashref' and 'order_by'.
INTERFACE
- _by_cust CUSTNUM[, PARAMS]
- The "by_cust" search method. Each subclass must implement this.
- cust_bill
- If the fee origin generates a fee based on past invoices (for example, an invoice event that charges late fees), this method should return the FS::cust_bill object that will be the basis for the fee. If this returns nothing, then then fee will be based on the rest of the invoice where it appears.
- cust_pkg
- If the fee origin generates a fee limited in scope to one package (for example, a package reconnection fee event), this method should return the FS::cust_pkg object the fee applies to. If it's a percentage fee, this determines which charges it's a percentage of; otherwise it just affects the fee description appearing on the invoice.
- Currently not tested in combination with "cust_bill"; be careful.
BUGS
SEE ALSO
FS::cust_event_fee, FS::cust_pkg_reason_fee, FS::cust_bill_pkg, FS::part_fee
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
- Around line 119:
- You forgot a '=back' before '=head1'