<% 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_event_fee

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. This is the implementation for event-triggered fees.

cust_bill

See "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. This version simply returns the event object if the event is a package event.

search_sql_where
join_sql

SUBROUTINES

process_delete

BUGS

SEE ALSO

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

<% include ('/elements/footer.html' ) %>