Ver código fonte

Processus de commande

feature/export_comptable
Fab 4 anos atrás
pai
commit
23f729e763
1 arquivos alterados com 13 adições e 3 exclusões
  1. +13
    -3
      ShopBundle/Services/Price/ProductPriceUtils.php

+ 13
- 3
ShopBundle/Services/Price/ProductPriceUtils.php Ver arquivo

@@ -28,7 +28,10 @@ class ProductPriceUtils

public function getPriceWithTax(ProductPropertyInterface $product)
{

return $this->applyTax(
$this->getPrice($product),
$product->getTaxRateInherited()->getValue()
);
}

public function getPriceWithTaxAndReduction(ProductPropertyInterface $product)
@@ -38,12 +41,19 @@ class ProductPriceUtils

public function getPriceByRefUnit(ProductPropertyInterface $product)
{

if ($product->getBehaviorPriceInherited() == 'by-piece') {
return ($this->getPrice($product) * $product->getUnitInherited()->getCoefficient()) / $product->getQuantityInherited();
} elseif ($product->getBehaviorPriceInherited() == 'by-reference-unit') {
return $product->getPriceByRefUnitInherited();
}
}

public function getPriceByRefUnitWithTax(ProductPropertyInterface $product)
{

return $this->applyTax(
$this->getPriceByRefUnit($product),
$product->getTaxRateInherited()->getValue()
);
}

public function getPriceByRefUnitWithTaxAndReduction(ProductPropertyInterface $product)

Carregando…
Cancelar
Salvar