2 FS::cust_credit - Object methods for cust_credit records
7 $record = new FS::cust_credit \%hash;
8 $record = new FS::cust_credit { 'column' => 'value' };
10 $error = $record->insert;
12 $error = $new_record->replace($old_record);
14 $error = $record->delete;
16 $error = $record->check;
19 An FS::cust_credit object represents a credit. FS::cust_credit
20 inherits from FS::Record. The following fields are currently
23 crednum - primary key (assigned automatically for new credits)
24 custnum - customer (see the FS::cust_main manpage)
25 amount - amount of the credit
26 credited - how much of this credit that is still outstanding, which is
27 amount minus all refunds (see the FS::cust_refund manpage).
28 _date - specified as a UNIX timestamp; see the section on "time" in the perlfunc manpage. Also see
29 the Time::Local manpage and the Date::Parse manpage for conversion functions.
30 otaker - order taker (assigned automatically, see the FS::UID manpage)
34 Creates a new credit. To add the credit to the database, see
35 the section on "insert".
38 Adds this credit to the database ("Posts" the credit). If
39 there is an error, returns the error, otherwise returns
42 When adding new invoices, credited must be amount (or null,
43 in which case it is automatically set to amount).
46 Currently unimplemented.
49 Replaces the OLD_RECORD with this one in the database. If
50 there is an error, returns the error, otherwise returns
53 Only credited may be changed. Credited is normally updated
54 by creating and inserting a refund (see the FS::cust_refund
58 Checks all fields to make sure this is a valid credit. If
59 there is an error, returns the error, otherwise returns
60 false. Called by the insert and replace methods.
63 $Id: cust_credit.txt,v 1.3 1999-04-08 13:39:32 ivan Exp $
69 the FS::Record manpage, the FS::cust_refund manpage, the
70 FS::cust_bill manpage, schema.html from the base documentation.
73 ivan@sisd.com 98-mar-17
75 pod, otaker from FS::UID ivan@sisd.com 98-sep-21
77 $Log: cust_credit.txt,v $
78 Revision 1.3 1999-04-08 13:39:32 ivan
79 convert from pod for 1.2.0 release
80 Revision 1.4 1999/01/25 12:26:08 ivan
81 yet more mod_perl stuff
83 Revision 1.3 1999/01/18 21:58:04 ivan esthetic: eq and ne were
84 used in a few places instead of == and !=
86 Revision 1.2 1998/12/29 11:59:38 ivan mostly properly OO, some
87 work still to be done with svc_ stuff