Browse Source

PriceUtils : getTotalReductions

feature/export_comptable
Guillaume 4 years ago
parent
commit
b1a49f9be7
1 changed files with 22 additions and 2 deletions
  1. +22
    -2
      ShopBundle/Services/Price/OrderShopPriceUtils.php

+ 22
- 2
ShopBundle/Services/Price/OrderShopPriceUtils.php View File

return $amountWithTax; 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 ;
} }
} }



Loading…
Cancel
Save