Преглед изворни кода

Correctif reductionCatalog

packProduct
Fabien Normand пре 2 година
родитељ
комит
505fb8fb4c
1 измењених фајлова са 13 додато и 2 уклоњено
  1. +13
    -2
      Solver/Price/PriceSolverTrait.php

+ 13
- 2
Solver/Price/PriceSolverTrait.php Прегледај датотеку

@@ -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);

Loading…
Откажи
Сачувај