Pārlūkot izejas kodu

Processus de commande

feature/export_comptable
Fab pirms 4 gadiem
vecāks
revīzija
a70a14b3f4
1 mainītis faili ar 16 papildinājumiem un 5 dzēšanām
  1. +16
    -5
      ShopBundle/Services/Price/OrderProductPriceUtils.php

+ 16
- 5
ShopBundle/Services/Price/OrderProductPriceUtils.php Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt