Ver código fonte

Ajout de methode dans priceSolver : excludeTax

feature/section_export
Fabien Normand 1 semana atrás
pai
commit
1854203d28
2 arquivos alterados com 12 adições e 1 exclusões
  1. +1
    -1
      Solver/Order/OrderShopSolver.php
  2. +11
    -0
      Solver/Price/PriceSolverTrait.php

+ 1
- 1
Solver/Order/OrderShopSolver.php Ver arquivo

@@ -232,7 +232,7 @@ class OrderShopSolver
}
return $arrayComplementaryOrderShops;
}
public function countValidComplementaryOrderShops(OrderShopInterface $orderShop): int
{
return count($this->getValidComplementaryOrderShops($orderShop));

+ 11
- 0
Solver/Price/PriceSolverTrait.php Ver arquivo

@@ -20,6 +20,17 @@ trait PriceSolverTrait
return $price;
}

public function excludeTax($price, $taxRateValue, $round = true)
{
$price = $this->applyPercentNegative($price, $taxRateValue);

if($round) {
return $this->round($price);
}

return $price;
}

public function applyReductionPercent($price, $percentage)
{
return $this->applyPercent($price, -$percentage);

Carregando…
Cancelar
Salvar