Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Closed/Complete status list
- */
- private $final_statuses = array('Closed','Completed');
- /**
- * Open statuses list
- */
- private $open_statuses = array('Open','WEB_REG','InProcess');
- /*
- * We only proceed if the SLX Ticket is of a certain area (Field Service)
- * and is InProcess or Open status and account.c_TMSintegration is checked ('T')
- */
- if($this->slx_object['c_TMSintegration'] == 'T' && $this->slx_object['AREA'] == 'Field Service'
- && in_array($this->slx_object['TEXT'],$this->open_statuses)) {
- $this->sync_related = FALSE;
- /*
- * Alternativly, if it is C_SENDTOTMS ('T') and Status is Closed/Completed
- * and AREA is Field Service|Routine Service
- */
- } elseif($this->slx_object['C_SENDTOTMS'] == 'T' && ($this->slx_object['AREA'] == 'Field Service' ||
- $this->slx_object['AREA'] == 'Routine Service') && in_array($this->slx_object['TEXT'],$this->final_statuses)) {
- $this->sync_related = TRUE;
- /*
- * Alt-Alternativly, if is C_SENDTOTMS but has some other status (e.g.
- * "Cancelled") then we still want to update the WO itself, but not the
- * related stuffs
- */
- } elseif($this->slx_object['C_SENDTOTMS'] == 'T'
- $this->sync_related = FALSE;
- } else {
- // exit
- }
- // logic for updating or creating the TMS WorkOrder
- if($this->sync_related == TRUE){
- // drop & re-create the Time Charges and Material Issues records
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement