Explorar el Código

[Frontend] Compte producteur : adaptation prix

master
Guillaume hace 4 años
padre
commit
24009c980d
Se han modificado 2 ficheros con 22 adiciones y 1 borrados
  1. +12
    -1
      ShopBundle/Services/Price/OrderProductPriceUtils.php
  2. +10
    -0
      ShopBundle/Services/Price/OrderShopPriceUtils.php

+ 12
- 1
ShopBundle/Services/Price/OrderProductPriceUtils.php Ver fichero

@@ -68,7 +68,10 @@ class OrderProductPriceUtils
return $orderProduct->getQuantityOrder() * $this->getPrice($orderProduct);
}


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

public function getMargin(OrderProductInterface $orderProduct)
{
@@ -120,6 +123,14 @@ class OrderProductPriceUtils
);
}

public function getTotalBuyingPriceWithTax(OrderProductInterface $orderProduct)
{
return $this->applyTax(
$this->getTotalBuyingPrice($orderProduct),
$orderProduct->getTaxRateInherited()->getValue()
);
}

//inclus toujours les réductions catalogues
public function getTotalTaxes(OrderProductInterface $orderProduct){
return $this->getTotalWithTaxAndReduction($orderProduct) - $this->getTotalWithReduction($orderProduct);

+ 10
- 0
ShopBundle/Services/Price/OrderShopPriceUtils.php Ver fichero

@@ -49,6 +49,16 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface
return $this->getTotalOrderProductsWithTaxByOrderProducts($orderShop->getOrderProducts()) ;
}

public function getTotalBuyingPriceOrderProductsWithTax($orderProducts):float
{
$total = 0;

foreach ($orderProducts as $orderProduct) {
$total += $this->orderProductPriceUtils->getTotalBuyingPriceWithTax($orderProduct);
}

return $total;
}

public function getTotalOrderProductsWithTaxByOrderProducts($orderProducts):float
{

Cargando…
Cancelar
Guardar