protected function InvoiceItem::applyAdjustments in Commerce Invoice 8.2
Applies adjustments to the given price.
Parameters
\Drupal\commerce_price\Price $price: The price.
string[] $adjustment_types: The adjustment types to include in the adjusted price. Examples: fee, promotion, tax. Defaults to all adjustment types.
Return value
\Drupal\commerce_price\Price The adjusted price.
1 call to InvoiceItem::applyAdjustments()
- InvoiceItem::getAdjustedTotalPrice in src/
Entity/ InvoiceItem.php - Gets the adjusted invoice item total price.
File
- src/
Entity/ InvoiceItem.php, line 243
Class
- InvoiceItem
- Defines the invoice item entity class.
Namespace
Drupal\commerce_invoice\EntityCode
protected function applyAdjustments(Price $price, array $adjustment_types = []) {
$adjusted_price = $price;
foreach ($this
->getAdjustments($adjustment_types) as $adjustment) {
if (!$adjustment
->isIncluded()) {
$adjusted_price = $adjusted_price
->add($adjustment
->getAmount());
}
}
return $adjusted_price;
}