Freeside:1.7:Documentation:Developer/FS/cust credit refund
From Freeside
Contents
NAME
FS::cust_credit_refund - Object methods for cust_bill_pay records
SYNOPSIS
use FS::cust_credit_refund; $record = new FS::cust_credit_refund \%hash; $record = new FS::cust_credit_refund { 'column' => 'value' }; $error = $record->insert; $error = $new_record->replace($old_record); $error = $record->delete; $error = $record->check;
DESCRIPTION
An FS::cust_credit_refund represents the application of a refund to a specific credit. FS::cust_credit_refund inherits from FS::Record. The following fields are currently supported:
- creditrefundnum - primary key (assigned automatically); crednum - Credit (see FS::cust_credit); refundnum - Refund (see FS::cust_refund); amount - Amount of the refund to apply to the specific credit.; _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 record. 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
- Remove this cust_credit_refund from the database. If there is an error, returns the error, otherwise returns false.
- replace OLD_RECORD
- Currently unimplemented (accounting reasons).
- check
- Checks all fields to make sure this is a valid refund application. If there is an error, returns the error, otherwise returns false. Called by the insert method.
- cust_refund
- Returns the refund (see FS::cust_refund)
- cust_credit
- Returns the credit (see FS::cust_credit)
BUGS
Delete and replace methods.
the checks for over-applied refunds could be better done like the ones in cust_bill_credit
SEE ALSO
FS::cust_credit, FS::cust_refund, FS::Record, schema.html from the base documentation.