|
|
@@ -50,12 +50,12 @@ trait PriceTrait |
|
|
|
|
|
|
|
public function getPriceByUnitRef(): ?float |
|
|
|
{ |
|
|
|
return ($this->getPriceInherited() * $this->getUnitInherited()->getCoefficient()) / $this->getQuantityInherited() ; |
|
|
|
return $this->calculatePriceByUnitRef($this->getPriceInherited()) ; |
|
|
|
} |
|
|
|
|
|
|
|
public function getPriceByUnitRefWithTax(): ?float |
|
|
|
{ |
|
|
|
return $this->calculatePriceWithTax($this->getPriceByUnitRef(), $this->getTaxRateInherited()->getValue()) ; |
|
|
|
return $this->calculatePriceByUnitRef($this->getPriceWithTax()) ; |
|
|
|
} |
|
|
|
|
|
|
|
public function setPrice(float $price): self |
|
|
@@ -95,4 +95,9 @@ trait PriceTrait |
|
|
|
$price = round(( ($price * 100)) / 100, 2) ; |
|
|
|
return $price ; |
|
|
|
} |
|
|
|
|
|
|
|
private function calculatePriceByUnitRef($price) |
|
|
|
{ |
|
|
|
return ($price * $this->getUnitInherited()->getCoefficient()) / $this->getQuantityInherited() ; |
|
|
|
} |
|
|
|
} |