- web interface for hourly account charges!
[freeside.git] / httemplate / docs / man / FS / cust_credit.html
1 <HTML>
2 <HEAD>
3 <TITLE>FS::cust_credit - Object methods for cust_credit records</TITLE>
4 <LINK REV="made" HREF="mailto:perl@packages.debian.org">
5 </HEAD>
6
7 <BODY>
8
9 <A NAME="__index__"></A>
10 <!-- INDEX BEGIN -->
11
12 <UL>
13
14         <LI><A HREF="#name">NAME</A></LI>
15         <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
16         <LI><A HREF="#description">DESCRIPTION</A></LI>
17         <LI><A HREF="#methods">METHODS</A></LI>
18         <LI><A HREF="#version">VERSION</A></LI>
19         <LI><A HREF="#bugs">BUGS</A></LI>
20         <LI><A HREF="#see also">SEE ALSO</A></LI>
21 </UL>
22 <!-- INDEX END -->
23
24 <HR>
25 <P>
26 <H1><A NAME="name">NAME</A></H1>
27 <P>FS::cust_credit - Object methods for cust_credit records</P>
28 <P>
29 <HR>
30 <H1><A NAME="synopsis">SYNOPSIS</A></H1>
31 <PRE>
32   use FS::cust_credit;</PRE>
33 <PRE>
34   $record = new FS::cust_credit \%hash;
35   $record = new FS::cust_credit { 'column' =&gt; 'value' };</PRE>
36 <PRE>
37   $error = $record-&gt;insert;</PRE>
38 <PRE>
39   $error = $new_record-&gt;replace($old_record);</PRE>
40 <PRE>
41   $error = $record-&gt;delete;</PRE>
42 <PRE>
43   $error = $record-&gt;check;</PRE>
44 <P>
45 <HR>
46 <H1><A NAME="description">DESCRIPTION</A></H1>
47 <P>An FS::cust_credit object represents a credit; the equivalent of a negative
48 <STRONG>cust_bill</STRONG> record (see <A HREF=".././FS/cust_bill.html">the FS::cust_bill manpage</A>).  FS::cust_credit inherits from
49 FS::Record.  The following fields are currently supported:</P>
50 <DL>
51 <DT><STRONG><A NAME="item_key">crednum - primary key (assigned automatically for new credits)</A></STRONG><BR>
52 <DD>
53 <DT><STRONG><A NAME="item_customer">custnum - customer (see <A HREF=".././FS/cust_main.html">the FS::cust_main manpage</A>)</A></STRONG><BR>
54 <DD>
55 <DT><STRONG><A NAME="item_amount_%2D_amount_of_the_credit">amount - amount of the credit</A></STRONG><BR>
56 <DD>
57 <DT><STRONG><A NAME="item__date_%2D_specified_as_a_UNIX_timestamp%3B_see_per">_date - specified as a UNIX timestamp; see <EM>perlfunc/``time''</EM>.  Also see
58 <A HREF="../Time/Local.html">the Time::Local manpage</A> and <A HREF="../Date/Parse.html">the Date::Parse manpage</A> for conversion functions.</A></STRONG><BR>
59 <DD>
60 <DT><STRONG><A NAME="item_taker">otaker - order taker (assigned automatically, see <A HREF=".././FS/UID.html">the FS::UID manpage</A>)</A></STRONG><BR>
61 <DD>
62 <DT><STRONG><A NAME="item_reason_%2D_text">reason - text</A></STRONG><BR>
63 <DD>
64 <DT><STRONG><A NAME="item_closed_%2D_books_closed_flag%2C_empty_or_%60Y%27">closed - books closed flag, empty or `Y'</A></STRONG><BR>
65 <DD>
66 </DL>
67 <P>
68 <HR>
69 <H1><A NAME="methods">METHODS</A></H1>
70 <DL>
71 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><BR>
72 <DD>
73 Creates a new credit.  To add the credit to the database, see <A HREF="#insert">insert</A>.
74 <P></P>
75 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><BR>
76 <DD>
77 Adds this credit to the database (``Posts'' the credit).  If there is an error,
78 returns the error, otherwise returns false.
79 <P></P>
80 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><BR>
81 <DD>
82 Currently unimplemented.
83 <P></P>
84 <DT><STRONG><A NAME="item_replace_OLD_RECORD">replace OLD_RECORD</A></STRONG><BR>
85 <DD>
86 Credits may not be modified; there would then be no record the credit was ever
87 posted.
88 <P></P>
89 <DT><STRONG><A NAME="item_check">check</A></STRONG><BR>
90 <DD>
91 Checks all fields to make sure this is a valid credit.  If there is an error,
92 returns the error, otherwise returns false.  Called by the insert and replace
93 methods.
94 <P></P>
95 <DT><STRONG><A NAME="item_cust_refund">cust_refund</A></STRONG><BR>
96 <DD>
97 Depreciated.  See the cust_credit_refund method.
98 <P>#Returns all refunds (see <A HREF=".././FS/cust_refund.html">the FS::cust_refund manpage</A>) for this credit.</P>
99 <P></P>
100 <DT><STRONG><A NAME="item_cust_credit_refund">cust_credit_refund</A></STRONG><BR>
101 <DD>
102 Returns all refund applications (see <A HREF=".././FS/cust_credit_refund.html">the FS::cust_credit_refund manpage</A>) for this credit.
103 <P></P>
104 <DT><STRONG><A NAME="item_cust_credit_bill">cust_credit_bill</A></STRONG><BR>
105 <DD>
106 Returns all application to invoices (see <A HREF=".././FS/cust_credit_bill.html">the FS::cust_credit_bill manpage</A>) for this
107 credit.
108 <P></P>
109 <DT><STRONG><A NAME="item_credited">credited</A></STRONG><BR>
110 <DD>
111 Returns the amount of this credit that is still outstanding; which is
112 amount minus all refund applications (see <A HREF=".././FS/cust_credit_refund.html">the FS::cust_credit_refund manpage</A>) and
113 applications to invoices (see <A HREF=".././FS/cust_credit_bill.html">the FS::cust_credit_bill manpage</A>).
114 <P></P></DL>
115 <P>
116 <HR>
117 <H1><A NAME="version">VERSION</A></H1>
118 <P>$Id: cust_credit.html,v 1.3 2002-01-29 17:42:46 ivan Exp $</P>
119 <P>
120 <HR>
121 <H1><A NAME="bugs">BUGS</A></H1>
122 <P>The delete method.</P>
123 <P>
124 <HR>
125 <H1><A NAME="see also">SEE ALSO</A></H1>
126 <P><A HREF=".././FS/Record.html">the FS::Record manpage</A>, <A HREF=".././FS/cust_credit_refund.html">the FS::cust_credit_refund manpage</A>, <A HREF=".././FS/cust_refund.html">the FS::cust_refund manpage</A>,
127 <A HREF=".././FS/cust_credit_bill.html">the FS::cust_credit_bill manpage</A> <A HREF=".././FS/cust_bill.html">the FS::cust_bill manpage</A>, schema.html from the base
128 documentation.</P>
129
130 </BODY>
131
132 </HTML>