http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/cust_credit_bill_pkg&feed=atom&action=historyFreeside:4:Documentation:Developer/FS/cust credit bill pkg - Revision history2024-03-28T19:28:26ZRevision history for this page on the wikiMediaWiki 1.27.7http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/cust_credit_bill_pkg&diff=9112&oldid=prevJeremyd: Edit via perl MediaWiki framework (1.13)2015-11-18T15:20:08Z<p>Edit via perl MediaWiki framework (1.13)</p>
<p><b>New page</b></p><div>==NAME==<br />
FS::cust_credit_bill_pkg - Object methods for cust_credit_bill_pkg records<br />
<br />
==SYNOPSIS==<br />
<code><br />
use FS::cust_credit_bill_pkg;<br />
<br />
$record = new FS::cust_credit_bill_pkg \%hash;<br />
$record = new FS::cust_credit_bill_pkg { 'column' => 'value' };<br />
<br />
$error = $record->insert;<br />
<br />
$error = $new_record->replace($old_record);<br />
<br />
$error = $record->delete;<br />
<br />
$error = $record->check;<br />
</code><br />
==DESCRIPTION==<br />
An FS::cust_credit_bill_pkg object represents application of a credit (see [[Freeside:4:Documentation:Developer/FS/cust credit bill|FS::cust_credit_bill]]) to a specific line item within an invoice (see [[Freeside:4:Documentation:Developer/FS/cust bill pkg|FS::cust_bill_pkg]]). FS::cust_credit_bill_pkg inherits from FS::Record. The following fields are currently supported:<br />
<br />
; creditbillpkgnum - primary key; creditbillnum - Credit application to the overall invoice (see [[Freeside:4:Documentation:Developer/FS/cust credit/bill|FS::cust_credit::bill]]); billpkgnum - Line item to which credit is applied (see [[Freeside:4:Documentation:Developer/FS/cust bill pkg|FS::cust_bill_pkg]]); amount - Amount of the credit applied to this line item.; setuprecur - 'setup' or 'recur', designates whether the payment was applied to the setup or recurring portion of the line item.; sdate - starting date of recurring fee; edate - ending date of recurring fee<br />
sdate and edate are specified as UNIX timestamps; see [[perlfunc#time|"time" in perlfunc]]. Also see [[Freeside:4:Documentation:Developer/Time/Local|Time::Local]] and [[Freeside:4:Documentation:Developer/Date/Parse|Date::Parse]] for conversion functions.<br />
<br />
==METHODS==<br />
; new HASHREF<br />
:Creates a new example. To add the example to the database, see [[#insert|"insert"]].<br />
<br />
:Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the ''hash'' method.<br />
; insert<br />
:Adds this record to the database. If there is an error, returns the error, otherwise returns false.<br />
; delete<br />
:Delete this record from the database.<br />
; replace OLD_RECORD<br />
:Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.<br />
; check<br />
:Checks all fields to make sure this is a valid credit applicaiton. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.<br />
<br />
==BUGS==<br />
'''setuprecur''' field is a kludge to compensate for cust_bill_pkg having separate setup and recur fields. It should be removed once that's fixed.<br />
<br />
'''insert''' method used to assume that the frequency of the package associated with the associated line item remained unchanged during the lifetime of the system. That is still used as a fallback. It may get the tax exemption adjustments wrong if package definitions change frequency. The presense of delete methods in FS::cust_main_county and FS::tax_rate makes crediting of old "texas tax" unreliable in the presense of changing taxes. Explicit tax credit requests? Carry 'taxable' onto line items?<br />
<br />
==SEE ALSO==<br />
[[Freeside:4:Documentation:Developer/FS/Record|FS::Record]], schema.html from the base documentation.</div>Jeremyd