|
|
@@ -54,6 +54,16 @@ trait PriceSolverTrait |
|
|
|
$round = true |
|
|
|
): ?float { |
|
|
|
|
|
|
|
|
|
|
|
if($entity instanceof ProductFamilyInterface) { |
|
|
|
$taxRate = $this->productFamilySolver->getTaxRateInherited($entity)->getValue(); |
|
|
|
}else if ($entity instanceof ProductInterface) { |
|
|
|
$taxRate = $this->productSolver->getTaxRateInherited($entity)->getValue(); |
|
|
|
}else{ |
|
|
|
$taxRate = $entity->getTaxRate(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($reductionCatalog) { |
|
|
|
$reductionCatalogValue = $reductionCatalog->getValue(); |
|
|
|
$reductionCatalogUnit = $reductionCatalog->getUnit(); |
|
|
@@ -96,7 +106,7 @@ trait PriceSolverTrait |
|
|
|
$price, |
|
|
|
$reductionCatalogValue * $quantity |
|
|
|
), |
|
|
|
$this->productFamilySolver->getTaxRateInherited($entity)->getValue() |
|
|
|
$taxRate |
|
|
|
); |
|
|
|
} elseif ($reductionCatalogBehaviorTaxRate == 'tax-included') { |
|
|
|
$priceWithTax = $this->applyReductionAmount( |
|
|
@@ -110,7 +120,8 @@ trait PriceSolverTrait |
|
|
|
if ($withTax) { |
|
|
|
$priceReturn = $priceWithTax; |
|
|
|
} else { |
|
|
|
$priceReturn = $this->applyPercentNegative($priceWithTax, $this->productFamilySolver->getTaxRateInherited($entity)->getValue()); |
|
|
|
|
|
|
|
$priceReturn = $this->applyPercentNegative($priceWithTax, $taxRate); |
|
|
|
} |
|
|
|
if ($round) { |
|
|
|
return $this->round($priceReturn); |