3 <TITLE>FS::cust_credit - Object methods for cust_credit records</TITLE>
4 <LINK REV="made" HREF="mailto:perl@packages.debian.org">
9 <A NAME="__index__"></A>
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>
26 <H1><A NAME="name">NAME</A></H1>
27 <P>FS::cust_credit - Object methods for cust_credit records</P>
30 <H1><A NAME="synopsis">SYNOPSIS</A></H1>
32 use FS::cust_credit;</PRE>
34 $record = new FS::cust_credit \%hash;
35 $record = new FS::cust_credit { 'column' => 'value' };</PRE>
37 $error = $record->insert;</PRE>
39 $error = $new_record->replace($old_record);</PRE>
41 $error = $record->delete;</PRE>
43 $error = $record->check;</PRE>
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>
51 <DT><STRONG><A NAME="item_key">crednum - primary key (assigned automatically for new credits)</A></STRONG><BR>
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>
55 <DT><STRONG><A NAME="item_amount_%2D_amount_of_the_credit">amount - amount of the credit</A></STRONG><BR>
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>
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>
62 <DT><STRONG><A NAME="item_reason_%2D_text">reason - text</A></STRONG><BR>
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>
69 <H1><A NAME="methods">METHODS</A></H1>
71 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><BR>
73 Creates a new credit. To add the credit to the database, see <A HREF="#insert">insert</A>.
75 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><BR>
77 Adds this credit to the database (``Posts'' the credit). If there is an error,
78 returns the error, otherwise returns false.
80 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><BR>
82 Currently unimplemented.
84 <DT><STRONG><A NAME="item_replace_OLD_RECORD">replace OLD_RECORD</A></STRONG><BR>
86 Credits may not be modified; there would then be no record the credit was ever
89 <DT><STRONG><A NAME="item_check">check</A></STRONG><BR>
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
95 <DT><STRONG><A NAME="item_cust_refund">cust_refund</A></STRONG><BR>
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>
100 <DT><STRONG><A NAME="item_cust_credit_refund">cust_credit_refund</A></STRONG><BR>
102 Returns all refund applications (see <A HREF=".././FS/cust_credit_refund.html">the FS::cust_credit_refund manpage</A>) for this credit.
104 <DT><STRONG><A NAME="item_cust_credit_bill">cust_credit_bill</A></STRONG><BR>
106 Returns all application to invoices (see <A HREF=".././FS/cust_credit_bill.html">the FS::cust_credit_bill manpage</A>) for this
109 <DT><STRONG><A NAME="item_credited">credited</A></STRONG><BR>
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>).
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>
121 <H1><A NAME="bugs">BUGS</A></H1>
122 <P>The delete method.</P>
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