Browse Source

Processus de commande

feature/export_comptable
Fab 4 years ago
parent
commit
a70a14b3f4
1 changed files with 16 additions and 5 deletions
  1. +16
    -5
      ShopBundle/Services/Price/OrderProductPriceUtils.php

+ 16
- 5
ShopBundle/Services/Price/OrderProductPriceUtils.php View File



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


public function getPriceWithTax(OrderProductInterface $orderProduct) public function getPriceWithTax(OrderProductInterface $orderProduct)
{ {

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


public function getPriceWithTaxAndReduction(OrderProductInterface $orderProduct) public function getPriceWithTaxAndReduction(OrderProductInterface $orderProduct)


} }



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


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


} }




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


public function getTotalWithReductionCatalog(OrderProductInterface $orderProduct) public function getTotalWithReductionCatalog(OrderProductInterface $orderProduct)


public function getTotalWithTax(OrderProductInterface $orderProduct) public function getTotalWithTax(OrderProductInterface $orderProduct)
{ {

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


public function getTotalWithTaxAndReductionCatalog(OrderProductInterface $orderProduct) public function getTotalWithTaxAndReductionCatalog(OrderProductInterface $orderProduct)

Loading…
Cancel
Save