Browse Source

[Frontend] Compte producteur : adaptation prix

master
Guillaume 4 years ago
parent
commit
24009c980d
2 changed files with 22 additions and 1 deletions
  1. +12
    -1
      ShopBundle/Services/Price/OrderProductPriceUtils.php
  2. +10
    -0
      ShopBundle/Services/Price/OrderShopPriceUtils.php

+ 12
- 1
ShopBundle/Services/Price/OrderProductPriceUtils.php View File

return $orderProduct->getQuantityOrder() * $this->getPrice($orderProduct); return $orderProduct->getQuantityOrder() * $this->getPrice($orderProduct);
} }



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


public function getMargin(OrderProductInterface $orderProduct) public function getMargin(OrderProductInterface $orderProduct)
{ {
); );
} }


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

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

+ 10
- 0
ShopBundle/Services/Price/OrderShopPriceUtils.php View File

return $this->getTotalOrderProductsWithTaxByOrderProducts($orderShop->getOrderProducts()) ; 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 public function getTotalOrderProductsWithTaxByOrderProducts($orderProducts):float
{ {

Loading…
Cancel
Save