regenerated perl api docs from embedded pod
[freeside.git] / htdocs / docs / man / cust_credit.txt
1 NAME
2     FS::cust_credit - Object methods for cust_credit records
3
4 SYNOPSIS
5       use FS::cust_credit;
6
7       $record = new FS::cust_credit \%hash;
8       $record = new FS::cust_credit { 'column' => 'value' };
9
10       $error = $record->insert;
11
12       $error = $new_record->replace($old_record);
13
14       $error = $record->delete;
15
16       $error = $record->check;
17
18 DESCRIPTION
19     An FS::cust_credit object represents a credit. FS::cust_credit
20     inherits from FS::Record. The following fields are currently
21     supported:
22
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)
31     reason - text
32 METHODS
33     new HASHREF
34         Creates a new credit. To add the credit to the database, see
35         the section on "insert".
36
37     insert
38         Adds this credit to the database ("Posts" the credit). If
39         there is an error, returns the error, otherwise returns
40         false.
41
42         When adding new invoices, credited must be amount (or null,
43         in which case it is automatically set to amount).
44
45     delete
46         Currently unimplemented.
47
48     replace OLD_RECORD
49         Replaces the OLD_RECORD with this one in the database. If
50         there is an error, returns the error, otherwise returns
51         false.
52
53         Only credited may be changed. Credited is normally updated
54         by creating and inserting a refund (see the FS::cust_refund
55         manpage).
56
57     check
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.
61
62 VERSION
63     $Id: cust_credit.txt,v 1.3 1999-04-08 13:39:32 ivan Exp $
64
65 BUGS
66     The delete method.
67
68 SEE ALSO
69     the FS::Record manpage, the FS::cust_refund manpage, the
70     FS::cust_bill manpage, schema.html from the base documentation.
71
72 HISTORY
73     ivan@sisd.com 98-mar-17
74
75     pod, otaker from FS::UID ivan@sisd.com 98-sep-21
76
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
82
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 !=
85
86     Revision 1.2 1998/12/29 11:59:38 ivan mostly properly OO, some
87     work still to be done with svc_ stuff
88