svc_hardware: better error messages for bad hw_addr when not validating as a MAC...
[freeside.git] / FS / FS / acct_rt_transaction.pm
index af959e4..ef0a275 100644 (file)
@@ -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