Freeside:3:Documentation:Developer/FS/cust credit bill
From Freeside
Contents
NAME
FS::cust_credit_bill - Object methods for cust_credit_bill records
SYNOPSIS
use FS::cust_credit_bill; $record = new FS::cust_credit_bill \%hash; $record = new FS::cust_credit_bill { 'column' => 'value' }; $error = $record->insert; $error = $new_record->replace($old_record); $error = $record->delete; $error = $record->check;
DESCRIPTION
An FS::cust_credit_bill object represents application of a credit (see FS::cust_credit) to an invoice (see FS::cust_bill). FS::cust_credit_bill inherits from FS::cust_bill_ApplicationCommon and FS::Record. The following fields are currently supported:
- creditbillnum - primary key; crednum - credit being applied; invnum - invoice to which credit is applied (see FS::cust_bill); amount - amount of the credit applied; _date - specified as a UNIX timestamp; see "time" in perlfunc. Also see Time::Local and Date::Parse for conversion functions.
METHODS
- new HASHREF
- Creates a new cust_credit_bill. To add the cust_credit_bill to the database, see "insert".
- insert
- Adds this cust_credit_bill to the database ("Posts" all or part of a credit). If there is an error, returns the error, otherwise returns false.
- delete
- Currently unimplemented.
- replace OLD_RECORD
- Application of credits may not be modified.
- check
- Checks all fields to make sure this is a valid credit application. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
- sub cust_credit
- Returns the credit (see FS::cust_credit)
BUGS
The delete method.
This probably should have been called cust_bill_credit.
SEE ALSO
FS::Record, FS::cust_bill, FS::cust_credit, schema.html from the base documentation.