Przeglądaj źródła

[Frontend] Compte producteur : adaptation prix

master
Guillaume 4 lat temu
rodzic
commit
24009c980d
2 zmienionych plików z 22 dodań i 1 usunięć
  1. +12
    -1
      ShopBundle/Services/Price/OrderProductPriceUtils.php
  2. +10
    -0
      ShopBundle/Services/Price/OrderShopPriceUtils.php

+ 12
- 1
ShopBundle/Services/Price/OrderProductPriceUtils.php Wyświetl plik

@@ -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 Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz