Difference between revisions of "Freeside:1.9:Documentation:Developer/FS/acct rt transaction"

From Freeside
Jump to: navigation, search
(import from POD)
(import from POD)
 
(2 intermediate revisions by the same user not shown)
Line 20: Line 20:
 
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:
 
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:
  
; svcrtid - primary key; svcnum - the svcnum of the svc_acct to which the time applies; transaction_id - the id of the rt transtaction from which the time applies; seconds - the amount of time which applies
+
; svcrtid
 +
:Primary key
 +
; svcnum
 +
:The svcnum of the svc_acct to which the time applies
 +
; transaction_id
 +
:The id of the rt transtaction from which the time applies
 +
; seconds
 +
:The amount of time applied from tickets
 +
; support
 +
:The amount of time applied to support services
 +
 
 
==METHODS==
 
==METHODS==
 
; new HASHREF
 
; new HASHREF
:Creates a new acct_rt_transaction. To add the example to the database, see [[Freeside:1.9:Documentation:Developer/#insert|"insert"|#insert|"insert"]].
+
:Creates a new acct_rt_transaction. To add the example to the database, see [[#insert|"insert"]].
  
 
: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.
 
: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.
Line 34: Line 44:
 
; check
 
; check
 
: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.
 
: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.
 +
; creator
 +
:Returns the creator of the RT transaction associated with this object.
 +
; ticketid
 +
:Returns the number of the RT ticket associated with this object.
 +
; subject
 +
:Returns the subject of the RT ticket associated with this object.
 +
; status
 +
:Returns the status of the RT ticket associated with this object.
 
; batch_insert SVC_ACCT_RT_TRANSACTION_OBJECT, ...
 
; batch_insert SVC_ACCT_RT_TRANSACTION_OBJECT, ...
 
: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.
 
: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.

Latest revision as of 20:03, 18 February 2008

NAME

FS::acct_rt_transaction - Object methods for acct_rt_transaction records

SYNOPSIS

 use FS::acct_rt_transaction;

 $record = new FS::acct_rt_transaction \%hash;
 $record = new FS::acct_rt_transaction { 'column' => 'value' };

 $error = $record->insert;

 $error = $new_record->replace($old_record);

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

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:

svcrtid
Primary key
svcnum
The svcnum of the svc_acct to which the time applies
transaction_id
The id of the rt transtaction from which the time applies
seconds
The amount of time applied from tickets
support
The amount of time applied to support services

METHODS

new HASHREF
Creates a new acct_rt_transaction. To add the example to the database, see "insert".
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.
insert
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
Delete this record from the database.
replace OLD_RECORD
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
check
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.
creator
Returns the creator of the RT transaction associated with this object.
ticketid
Returns the number of the RT ticket associated with this object.
subject
Returns the subject of the RT ticket associated with this object.
status
Returns the status of the RT ticket associated with this object.
batch_insert SVC_ACCT_RT_TRANSACTION_OBJECT, ...
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.
For example:

 my $errors = FS::acct_rt_transaction->batch_insert(@transactions);
 if ( $error ) {
   #success; all payments were inserted
 } else {
   #failure; no payments were inserted.
 }

BUGS

Possibly the delete method or others.

SEE ALSO

FS::Record, schema.html from the base documentation.