% 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_refund - Object method for cust_refund objects
use FS::cust_refund;
$record = new FS::cust_refund \%hash;
$record = new FS::cust_refund { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::cust_refund represents a refund: the transfer of money to a customer; equivalent to a negative payment (see FS::cust_pay). FS::cust_refund inherits from FS::Record. The following fields are currently supported:
primary key (assigned automatically for new refunds)
customer (see FS::cust_main)
Amount of the refund
Text stating the reason for the refund ( deprecated )
Reason (see FS::reason)
specified as a UNIX timestamp; see "time" in perlfunc. Also see Time::Local and Date::Parse for conversion functions.
Payment Type (See FS::payinfo_Mixin for valid payby values)
Payment Information (See FS::payinfo_Mixin for data format)
Detected credit card type, if appropriate; autodetected.
Masked payinfo (See FS::payinfo_Mixin for how this works)
text field for tracking card processing
order taker (see FS::access_user
books closed flag, empty or `Y'
Same as for FS::cust_pay, but specifically the result of realtime authorization of the refund.
Creates a new refund. To add the refund to the database, see "insert".
Adds this refund to the database.
For backwards-compatibility and convenience, if the additional field crednum is defined, an FS::cust_credit_refund record for the full amount of the refund will be created. Or (this time for convenience and consistancy), if the additional field paynum is defined, an FS::cust_pay_refund record for the full amount of the refund will be created. In both cases, custnum is optional.
Unless the closed flag is set, deletes this refund and all associated applications (see FS::cust_credit_refund and FS::cust_pay_refund).
You can, but probably shouldn't modify refunds...
Replaces the OLD_RECORD with this one in the database, or, if OLD_RECORD is not supplied, replaces this record. If there is an error, returns the error, otherwise returns false.
Checks all fields to make sure this is a valid refund. If there is an error, returns the error, otherwise returns false. Called by the insert method.
Returns all applications to credits (see FS::cust_credit_refund) for this refund.
Returns all applications to payments (see FS::cust_pay_refund) for this refund.
Returns the amount of this refund that is still unapplied; which is amount minus all credit applications (see FS::cust_credit_refund) and payment applications (see FS::cust_pay_refund).
Sends a payment receipt for this payment.
refund_receipt_msgnum must be configured.
Available options:
Customer (FS::cust_main) object (for efficiency).
Returns an SQL fragment to retreive the unapplied amount.
Returns the text of the associated reason (see FS::reason) for this credit.
Delete and replace methods.
FS::Record, FS::cust_credit, schema.html from the base documentation.