本文整理汇总了PHP中Opportunity::updateCalculatedFields方法的典型用法代码示例。如果您正苦于以下问题:PHP Opportunity::updateCalculatedFields方法的具体用法?PHP Opportunity::updateCalculatedFields怎么用?PHP Opportunity::updateCalculatedFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Opportunity
的用法示例。
在下文中一共展示了Opportunity::updateCalculatedFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform_save
/**
* @param Opportunity $focus The Current Opportunity we are working with
*/
function perform_save($focus)
{
global $app_list_strings, $timedate, $current_language;
$app_list_strings = return_app_list_strings_language($current_language);
/* @var $admin Administration */
$admin = BeanFactory::getBean('Administration');
$settings = $admin->getConfigForModule('Forecasts');
// if any of the case fields are NULL or an empty string set it to the amount from the main opportunity
if (is_null($focus->best_case) || strval($focus->best_case) === "") {
$focus->best_case = $focus->amount;
}
if (is_null($focus->worst_case) || strval($focus->worst_case) === "") {
$focus->worst_case = $focus->amount;
}
// Bug49495: amount may be a calculated field
$focus->updateCalculatedFields();
//Store the base currency value
if (isset($focus->amount) && !number_empty($focus->amount)) {
$focus->amount_usdollar = SugarCurrency::convertWithRate($focus->amount, $focus->base_rate);
}
}