public function run() { // if we are not going to ent or ult, we need to kick out if (!in_array(strtolower($this->to_flavor), $this->validFlavors)) { return; } // to run this we must be coming any version of 7 before 7.6 if (version_compare($this->from_version, '7.0', '>=') && version_compare($this->from_version, '7.6', '<')) { SugarAutoLoader::load('modules/Opportunities/include/OpportunityWithRevenueLineItem.php'); SugarAutoLoader::load('modules/ModuleBuilder/Module/StudioModuleFactory.php'); // clear out the studio module cache cause it will be wrong! StudioModuleFactory::clearModuleCache('Opportunities'); // in the upgrade, we only want to do the metadata conversion $converter = new OpportunityWithRevenueLineItem(); $converter->doMetadataConvert(); // just on the off chance that the formula got put into a custom file, we need to make sure it contains // the new hotness $this->fixRollupFormulas(); $admin = BeanFactory::getBean('Administration'); $admin->saveSetting('Opportunities', 'opps_view_by', 'RevenueLineItems', 'base'); Opportunity::getSettings(true); } }