コード例 #1
0
 /**
  * Set sources, department, location based on activa_source (as per George)
  * @return void
  */
 protected function _setSources()
 {
     $oDb = new Netsuite_Db_Model();
     $aSources = $oDb->getSources($this->_record['_source']);
     switch ($this->_record['recordtype']) {
         case 'customer':
             $this->_record['custentitycustomer_department'] = (int) $aSources['department'];
             $this->_record['custentity_customer_source'] = (int) $aSources['cust_source'];
             $this->_record['leadsource'] = (int) $aSources['lead'];
             break;
         case 'salesorder':
             $this->_record['custbody_order_source'] = (int) $aSources['order_source'];
             $this->_record['location'] = (int) $aSources['location'];
             $this->_record['department'] = (int) $aSources['department'];
             $this->_record['leadsource'] = (int) $aSources['lead'];
             $this->_record['ccprocessor'] = (int) $aSources['cc_processor'];
             break;
     }
 }