本文整理匯總了PHP中Operation::getAmountForBudget方法的典型用法代碼示例。如果您正苦於以下問題:PHP Operation::getAmountForBudget方法的具體用法?PHP Operation::getAmountForBudget怎麽用?PHP Operation::getAmountForBudget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Operation
的用法示例。
在下文中一共展示了Operation::getAmountForBudget方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: calculate
/**
* Вычисляет вклад операции в статью бюджета
* @param Operation $operation
* @return BudgetArticleIncrement
*/
public function calculate(Operation $operation)
{
$increment = new BudgetArticleIncrement();
//получаем модуль вклада операции в бюджет:
//получаем без знака
$signed = false;
$operationContributionAmount = $operation->getAmountForBudget($this->_currency, $signed);
if ($operation->getDate() < $this->_startDate->format('Y-m-d')) {
$increment->mean += $operationContributionAmount / $this->_meanRateMonthsAmount;
} else {
if (!$operation->isFromCalendar()) {
$increment->adhoc += $operationContributionAmount;
} else {
if ($operation->isAccepted()) {
$increment->calendarAccepted += $operationContributionAmount;
} else {
$increment->calendarFuture += $operationContributionAmount;
}
}
}
return $increment;
}
示例2: setOperation
public function setOperation(Operation $operation)
{
$this->_levelValues["parentCategory"] = $operation->getCategory()->getParentCategory();
$this->_levelValues["category"] = $operation->getCategory();
$tags = array_map('trim', explode(',', $operation->getTags()));
$tag = isset($tags[0]) ? $tags[0] : null;
$this->_levelValues["tag"] = $tag;
$this->amount = $operation->getAmountForBudget($this->currency, true);
}