Parcourir la source

PriceUtils : getTotalReductions

feature/export_comptable
Guillaume il y a 3 ans
Parent
révision
b1a49f9be7
1 fichiers modifiés avec 22 ajouts et 2 suppressions
  1. +22
    -2
      ShopBundle/Services/Price/OrderShopPriceUtils.php

+ 22
- 2
ShopBundle/Services/Price/OrderShopPriceUtils.php Voir le fichier

@@ -301,14 +301,34 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface
return $amountWithTax;
}

public function getTotalReductions()
public function getTotalReductions(OrderShopInterface $orderShop)
{
$total = 0 ;

foreach($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$total += $this->getOrderProductsReductionCartAmountWithoutTax($orderShop, $orderReductionCart) ;
}

foreach($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$total += $this->getOrderProductsReductionCreditAmountWithoutTax($orderShop, $orderReductionCredit) ;
}

return $total ;
}

public function getTotalReductionsWithTax()
public function getTotalReductionsWithTax(OrderShopInterface $orderShop)
{
$total = 0 ;

foreach($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$total += $this->getOrderProductsReductionCartAmountWithTax($orderShop, $orderReductionCart) ;
}

foreach($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$total += $this->getOrderProductsReductionCreditAmountWithTax($orderShop, $orderReductionCredit) ;
}

return $total ;
}
}


Chargement…
Annuler
Enregistrer