瀏覽代碼

PriceUtils : getTotalReductions

feature/export_comptable
Guillaume 3 年之前
父節點
當前提交
b1a49f9be7
共有 1 個檔案被更改,包括 22 行新增2 行删除
  1. +22
    -2
      ShopBundle/Services/Price/OrderShopPriceUtils.php

+ 22
- 2
ShopBundle/Services/Price/OrderShopPriceUtils.php 查看文件

@@ -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 ;
}
}


Loading…
取消
儲存