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>
67 <H1><A NAME="methods">METHODS</A></H1>
69 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><BR>
71 Creates a new credit. To add the credit to the database, see <A HREF="#insert">insert</A>.
73 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><BR>
75 Adds this credit to the database (``Posts'' the credit). If there is an error,
76 returns the error, otherwise returns false.
78 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><BR>
80 Currently unimplemented.
82 <DT><STRONG><A NAME="item_replace_OLD_RECORD">replace OLD_RECORD</A></STRONG><BR>
84 Credits may not be modified; there would then be no record the credit was ever
87 <DT><STRONG><A NAME="item_check">check</A></STRONG><BR>
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
93 <DT><STRONG><A NAME="item_cust_refund">cust_refund</A></STRONG><BR>
95 Returns all refunds (see <A HREF=".././FS/cust_refund.html">the FS::cust_refund manpage</A>) for this credit.
97 <DT><STRONG><A NAME="item_credited">credited</A></STRONG><BR>
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>).
104 <H1><A NAME="version">VERSION</A></H1>
105 <P>$Id: cust_credit.html,v 1.1 2001-07-30 07:36:03 ivan Exp $</P>
108 <H1><A NAME="bugs">BUGS</A></H1>
109 <P>The delete method.</P>
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