Advertisement
matthewpoer

MIS/TMS Record Filters - Proposed Change

May 8th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1.     /**
  2.      * Closed/Complete status list
  3.      */
  4.     private $final_statuses = array('Closed','Completed');
  5.    
  6.     /**
  7.      * Open statuses list
  8.      */
  9.     private $open_statuses = array('Open','WEB_REG','InProcess');
  10.    
  11.     /*
  12.      * We only proceed if the SLX Ticket is of a certain area (Field Service)
  13.      * and is InProcess or Open status and account.c_TMSintegration is checked ('T')
  14.      */
  15.     if($this->slx_object['c_TMSintegration'] == 'T' && $this->slx_object['AREA'] == 'Field Service'
  16.         && in_array($this->slx_object['TEXT'],$this->open_statuses)) {
  17.         $this->sync_related = FALSE;
  18.        
  19.     /*
  20.      * Alternativly, if it is C_SENDTOTMS ('T') and Status is Closed/Completed
  21.      * and AREA is Field Service|Routine Service
  22.      */
  23.     } elseif($this->slx_object['C_SENDTOTMS'] == 'T' && ($this->slx_object['AREA'] == 'Field Service' ||
  24.         $this->slx_object['AREA'] == 'Routine Service') && in_array($this->slx_object['TEXT'],$this->final_statuses)) {
  25.         $this->sync_related = TRUE;
  26.    
  27.     /*
  28.      * Alt-Alternativly, if is C_SENDTOTMS but has some other status (e.g.
  29.      * "Cancelled") then we still want to update the WO itself, but not the
  30.      * related stuffs
  31.      */
  32.     } elseif($this->slx_object['C_SENDTOTMS'] == 'T'
  33.         $this->sync_related = FALSE;
  34.  
  35.     } else {
  36.         // exit
  37.     }
  38.    
  39.     // logic for updating or creating the TMS WorkOrder
  40.    
  41.     if($this->sync_related == TRUE){
  42.         // drop & re-create the Time Charges and Material Issues records
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement