X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Facct_rt_transaction.pm;h=ef0a2753315732d2746ec3a20bee45740a92c409;hp=af959e47f0b2c921971be28cde00f15680cbb6f4;hb=8d0e8149e7b19ad8543ac6c8c663be63dbc34762;hpb=db18a813b59b8254ff19f77770750a781613d79e diff --git a/FS/FS/acct_rt_transaction.pm b/FS/FS/acct_rt_transaction.pm index af959e47f..ef0a27533 100644 --- a/FS/FS/acct_rt_transaction.pm +++ b/FS/FS/acct_rt_transaction.pm @@ -33,14 +33,25 @@ FS::Record. The following fields are currently supported: =over 4 -=item svcrtid - primary key +=item svcrtid -=item svcnum - the svcnum of the svc_acct to which the time applies +Primary key -=item transaction_id - the id of the rt transtaction from which the time applies +=item svcnum -=item seconds - the amount of time which applies +The svcnum of the svc_acct to which the time applies +=item transaction_id + +The id of the rt transtaction from which the time applies + +=item seconds + +The amount of time applied from tickets + +=item support + +The amount of time applied to support services =back @@ -92,7 +103,7 @@ sub insert { return "Can't find svc_acct " . $self->svcnum; } - my $error = $svc_acct->decrement_seconds($self->seconds); + $error = $svc_acct->decrement_seconds($self->support); if ( $error ) { $dbh->rollback if $oldAutoCommit; return "Error incrementing service seconds: $error"; @@ -136,7 +147,7 @@ sub delete { return "Can't find svc_acct " . $self->svcnum; } - my $error = $svc_acct->increment_seconds($self->seconds); + $error = $svc_acct->increment_seconds($self->support); if ( $error ) { $dbh->rollback if $oldAutoCommit; return "Error incrementing service seconds: $error"; @@ -173,6 +184,7 @@ sub check { || $self->ut_number('transaction_id') || $self->ut_numbern('_date') || $self->ut_snumber('seconds') + || $self->ut_snumber('support') ; return $error if $error; @@ -196,6 +208,50 @@ sub check { $self->SUPER::check; } +=item creator + +Returns the creator of the RT transaction associated with this object. + +=cut + +sub creator { + my $self = shift; + FS::TicketSystem->transaction_creator($self->transaction_id); +} + +=item ticketid + +Returns the number of the RT ticket associated with this object. + +=cut + +sub ticketid { + my $self = shift; + FS::TicketSystem->transaction_ticketid($self->transaction_id); +} + +=item subject + +Returns the subject of the RT ticket associated with this object. + +=cut + +sub subject { + my $self = shift; + FS::TicketSystem->transaction_subject($self->transaction_id); +} + +=item status + +Returns the status of the RT ticket associated with this object. + +=cut + +sub status { + my $self = shift; + FS::TicketSystem->transaction_status($self->transaction_id); +} + =item batch_insert SVC_ACCT_RT_TRANSACTION_OBJECT, ... Class method which inserts multiple time applications. Takes a list of