f08424561c9f46905684be8ae70959ae79967d6e
[freeside.git] / htdocs / 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 </DL>
65 <P>
66 <HR>
67 <H1><A NAME="methods">METHODS</A></H1>
68 <DL>
69 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><BR>
70 <DD>
71 Creates a new credit.  To add the credit to the database, see <A HREF="#insert">insert</A>.
72 <P></P>
73 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><BR>
74 <DD>
75 Adds this credit to the database (``Posts'' the credit).  If there is an error,
76 returns the error, otherwise returns false.
77 <P></P>
78 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><BR>
79 <DD>
80 Currently unimplemented.
81 <P></P>
82 <DT><STRONG><A NAME="item_replace_OLD_RECORD">replace OLD_RECORD</A></STRONG><BR>
83 <DD>
84 Credits may not be modified; there would then be no record the credit was ever
85 posted.
86 <P></P>
87 <DT><STRONG><A NAME="item_check">check</A></STRONG><BR>
88 <DD>
89 Checks all fields to make sure this is a valid credit.  If there is an error,
90 returns the error, otherwise returns false.  Called by the insert and replace
91 methods.
92 <P></P>
93 <DT><STRONG><A NAME="item_cust_refund">cust_refund</A></STRONG><BR>
94 <DD>
95 Returns all refunds (see <A HREF=".././FS/cust_refund.html">the FS::cust_refund manpage</A>) for this credit.
96 <P></P>
97 <DT><STRONG><A NAME="item_credited">credited</A></STRONG><BR>
98 <DD>
99 Returns the amount of this credit that is still outstanding; which is
100 amount minus all refunds (see <A HREF=".././FS/cust_refund.html">the FS::cust_refund manpage</A>).
101 <P></P></DL>
102 <P>
103 <HR>
104 <H1><A NAME="version">VERSION</A></H1>
105 <P>$Id: cust_credit.html,v 1.3 2001-04-23 12:40:31 ivan Exp $</P>
106 <P>
107 <HR>
108 <H1><A NAME="bugs">BUGS</A></H1>
109 <P>The delete method.</P>
110 <P>
111 <HR>
112 <H1><A NAME="see also">SEE ALSO</A></H1>
113 <P><A HREF=".././FS/Record.html">the FS::Record manpage</A>, <A HREF=".././FS/cust_refund.html">the FS::cust_refund manpage</A>, <A HREF=".././FS/cust_bill.html">the FS::cust_bill manpage</A>, schema.html from the base
114 documentation.</P>
115
116 </BODY>
117
118 </HTML>