public function InvoiceItem::setUnitPrice in Commerce Invoice 8.2
Sets the invoice item unit price.
Parameters
\Drupal\commerce_price\Price $unit_price: The invoice item unit price.
Return value
$this
Overrides InvoiceItemInterface::setUnitPrice
File
- src/
Entity/ InvoiceItem.php, line 140
Class
- InvoiceItem
- Defines the invoice item entity class.
Namespace
Drupal\commerce_invoice\EntityCode
public function setUnitPrice(Price $unit_price) {
$this
->set('unit_price', $unit_price);
$this
->recalculateTotalPrice();
return $this;
}