Difference between revisions of "Freeside:3:Documentation:Developer/FS/cust event fee"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
m (Edit via perl MediaWiki framework (1.13))
 
(One intermediate revision by the same user not shown)
Line 18: Line 18:
 
</code>
 
</code>
 
==DESCRIPTION==
 
==DESCRIPTION==
An FS::cust_event_fee object links a billing event that charged a fee (an [[Freeside:3:Documentation:Developer/FS/cust event|FS::cust_event]]) to the resulting invoice line item (an [[Freeside:3:Documentation:Developer/FS/cust bill pkg|FS::cust_bill_pkg]] object). FS::cust_event_fee inherits from FS::Record. The following fields are currently supported:
+
An FS::cust_event_fee object links a billing event that charged a fee (an [[Freeside:3:Documentation:Developer/FS/cust event|FS::cust_event]]) to the resulting invoice line item (an [[Freeside:3:Documentation:Developer/FS/cust bill pkg|FS::cust_bill_pkg]] object). FS::cust_event_fee inherits from FS::Record and FS::FeeOrigin_Mixin. The following fields are currently supported:
  
 
; eventfeenum - primary key; eventnum - key of the cust_event record that required the fee to be created. This is a unique column; there's no reason for a single event instance to create more than one fee.; billpkgnum - key of the cust_bill_pkg record representing the fee on an invoice. This is also 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 ([[Freeside:3:Documentation:Developer/FS/part fee|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.
 
; eventfeenum - primary key; eventnum - key of the cust_event record that required the fee to be created. This is a unique column; there's no reason for a single event instance to create more than one fee.; billpkgnum - key of the cust_bill_pkg record representing the fee on an invoice. This is also 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 ([[Freeside:3:Documentation:Developer/FS/part fee|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.
Line 34: Line 34:
  
 
==CLASS METHODS==
 
==CLASS METHODS==
; by_cust CUSTNUM[, PARAMS]
+
; _by_cust CUSTNUM[, PARAMS]
:Finds all cust_event_fee records belonging to the customer CUSTNUM. Currently fee events can be cust_main, cust_pkg, or cust_bill events; this will return all of them.
+
:See [[Freeside:3:Documentation:Developer/FS/FeeOrigin Mixin#by cust|"by cust" in FS/FeeOrigin Mixin|FS::FeeOrigin_Mixin#by_cust|"by_cust" in FS::FeeOrigin_Mixin]]. This is the implementation for event-triggered fees.
 
+
; cust_bill
:PARAMS can be additional params to pass to qsearch; this really only works for 'hashref' and 'order_by'.
+
:See [[Freeside:3:Documentation:Developer/FS/FeeOrigin Mixin#cust bill|"cust bill" in FS/FeeOrigin Mixin|FS::FeeOrigin_Mixin#cust_bill|"cust_bill" in FS::FeeOrigin_Mixin]]. This version simply returns the event object if the event is an invoice event.
 +
; cust_pkg
 +
:See [[Freeside:3:Documentation:Developer/FS/FeeOrigin Mixin#cust bill|"cust bill" in FS/FeeOrigin Mixin|FS::FeeOrigin_Mixin#cust_bill|"cust_bill" in FS::FeeOrigin_Mixin]]. This version simply returns the event object if the event is a package event.
  
 
==BUGS==
 
==BUGS==
 
==SEE ALSO==
 
==SEE ALSO==
[[Freeside:3:Documentation:Developer/FS/cust event|FS::cust_event]], [[Freeside:3:Documentation:Developer/FS/part fee|FS::part_fee]], [[Freeside:3:Documentation:Developer/FS/Record|FS::Record]]
+
[[Freeside:3:Documentation:Developer/FS/cust event|FS::cust_event]], [[Freeside:3:Documentation:Developer/FS/FeeOrigin Mixin|FS::FeeOrigin_Mixin]], [[Freeside:3:Documentation:Developer/FS/Record|FS::Record]]
  
 
==POD ERRORS==
 
==POD ERRORS==
 
Hey! '''The above document had some coding errors, which are explained below:'''
 
Hey! '''The above document had some coding errors, which are explained below:'''
  
; Around line 184&#58;
+
; Around line 205&#58;
 
:You forgot a '=back' before '=head1'
 
:You forgot a '=back' before '=head1'

Latest revision as of 09:58, 10 April 2015

NAME

FS::cust_event_fee - Object methods for cust_event_fee 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::cust_event_fee object links a billing event that charged a fee (an FS::cust_event) to the resulting invoice line item (an FS::cust_bill_pkg object). FS::cust_event_fee inherits from FS::Record and FS::FeeOrigin_Mixin. The following fields are currently supported:

eventfeenum - primary key; eventnum - key of the cust_event record that required the fee to be created. This is a unique column; there's no reason for a single event instance to create more than one fee.; billpkgnum - key of the cust_bill_pkg record representing the fee on an invoice. This is also 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.

METHODS

new HASHREF
Creates a new event-fee link. To add the record to the database, see "insert".
insert
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
Delete this record from the database.
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 example. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.

CLASS METHODS

_by_cust CUSTNUM[, PARAMS]
See "by cust" in FS/FeeOrigin Mixin|FS::FeeOrigin_Mixin#by_cust|"by_cust" in FS::FeeOrigin_Mixin. This is the implementation for event-triggered fees.
cust_bill
See "cust bill" in FS/FeeOrigin Mixin|FS::FeeOrigin_Mixin#cust_bill|"cust_bill" in FS::FeeOrigin_Mixin. This version simply returns the event object if the event is an invoice event.
cust_pkg
See "cust bill" in FS/FeeOrigin Mixin|FS::FeeOrigin_Mixin#cust_bill|"cust_bill" in FS::FeeOrigin_Mixin. This version simply returns the event object if the event is a package event.

BUGS

SEE ALSO

FS::cust_event, FS::FeeOrigin_Mixin, FS::Record

POD ERRORS

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

Around line 205:
You forgot a '=back' before '=head1'