http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/acct_rt_transaction&feed=atom&action=historyFreeside:4:Documentation:Developer/FS/acct rt transaction - Revision history2024-03-29T10:18:10ZRevision history for this page on the wikiMediaWiki 1.27.7http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/acct_rt_transaction&diff=9029&oldid=prevJeremyd: Edit via perl MediaWiki framework (1.13)2015-11-18T15:16:46Z<p>Edit via perl MediaWiki framework (1.13)</p>
<p><b>New page</b></p><div>==NAME==<br />
FS::acct_rt_transaction - Object methods for acct_rt_transaction records<br />
<br />
==SYNOPSIS==<br />
<code><br />
use FS::acct_rt_transaction;<br />
<br />
$record = new FS::acct_rt_transaction \%hash;<br />
$record = new FS::acct_rt_transaction { '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::acct_rt_transaction object represents an application of time from a rt transaction to a svc_acct. FS::acct_rt_transaction inherits from FS::Record. The following fields are currently supported:<br />
<br />
; svcrtid<br />
:Primary key<br />
; svcnum<br />
:The svcnum of the svc_acct to which the time applies<br />
; transaction_id<br />
:The id of the rt transtaction from which the time applies<br />
; seconds<br />
:The amount of time applied from tickets<br />
; support<br />
:The amount of time applied to support services<br />
<br />
==METHODS==<br />
; new HASHREF<br />
:Creates a new acct_rt_transaction. 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 acct_rt_transaction. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.<br />
; creator<br />
:Returns the creator of the RT transaction associated with this object.<br />
; ticketid<br />
:Returns the number of the RT ticket associated with this object.<br />
; subject<br />
:Returns the subject of the RT ticket associated with this object.<br />
; status<br />
:Returns the status of the RT ticket associated with this object.<br />
; batch_insert SVC_ACCT_RT_TRANSACTION_OBJECT, ...<br />
:Class method which inserts multiple time applications. Takes a list of FS::acct_rt_transaction objects. If there is an error inserting any application, the entire transaction is rolled back, i.e. all time is applied or none is.<br />
<br />
:For example:<br />
<code><br />
my $errors = FS::acct_rt_transaction->batch_insert(@transactions);<br />
if ( $error ) {<br />
#success; all payments were inserted<br />
} else {<br />
#failure; no payments were inserted.<br />
}<br />
</code><br />
<br />
==BUGS==<br />
Possibly the delete method or others.<br />
<br />
==SEE ALSO==<br />
[[Freeside:4:Documentation:Developer/FS/Record|FS::Record]], schema.html from the base documentation.</div>Jeremyd