Ver código fonte

Processus de commande

feature/export_comptable
Fab 4 anos atrás
pai
commit
a70a14b3f4
1 arquivos alterados com 16 adições e 5 exclusões
  1. +16
    -5
      ShopBundle/Services/Price/OrderProductPriceUtils.php

+ 16
- 5
ShopBundle/Services/Price/OrderProductPriceUtils.php Ver arquivo

@@ -23,12 +23,15 @@ class OrderProductPriceUtils

public function getPrice(OrderProductInterface $orderProduct)
{
return $orderProduct->getPrice();
}

public function getPriceWithTax(OrderProductInterface $orderProduct)
{

return $this->applyTax(
$this->getPrice($orderProduct),
$orderProduct->getTaxRate()->getValue()
);
}

public function getPriceWithTaxAndReduction(OrderProductInterface $orderProduct)
@@ -36,13 +39,18 @@ class OrderProductPriceUtils

}


public function getPriceByRefUnit(OrderProductInterface $orderProduct)
{
return ($this->getPrice($orderProduct) * $orderProduct->getUnit()->getCoefficient()) / $orderProduct->getQuantityProduct();
}

public function getPriceByRefUnitWithTax(OrderProductInterface $orderProduct)
{
return $this->applyTax(
$this->getPriceByRefUnit($orderProduct),
$orderProduct->getTaxRate()->getValue()
);

}

@@ -53,7 +61,7 @@ class OrderProductPriceUtils

public function getTotal(OrderProductInterface $orderProduct)
{
return $orderProduct->getQuantityOrder() * $this->getPrice($orderProduct);
}

public function getTotalWithReductionCatalog(OrderProductInterface $orderProduct)
@@ -73,7 +81,10 @@ class OrderProductPriceUtils

public function getTotalWithTax(OrderProductInterface $orderProduct)
{

return $this->applyTax(
$this->getTotal($orderProduct),
$orderProduct->getTaxRateInherited()->getValue()
);
}

public function getTotalWithTaxAndReductionCatalog(OrderProductInterface $orderProduct)

Carregando…
Cancelar
Salvar