|
|
|
|
|
|
|
|
public function getTotalOrderProductsWithReductions(OrderShopInterface $orderShop) |
|
|
public function getTotalOrderProductsWithReductions(OrderShopInterface $orderShop) |
|
|
{ |
|
|
{ |
|
|
$total = $this->getTotalOrderProducts($orderShop) ; |
|
|
$total = $this->getTotalOrderProducts($orderShop) ; |
|
|
|
|
|
$total -= $this->getTotalReductionCartsAmount($orderShop) ; |
|
|
|
|
|
$total -= $this->getTotalReductionCreditsAmount($orderShop) ; |
|
|
|
|
|
return $total ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getTotalOrderProductsWithReductionCarts(OrderShopInterface $orderShop) |
|
|
|
|
|
{ |
|
|
|
|
|
$total = $this->getTotalOrderProducts($orderShop) ; |
|
|
|
|
|
$total -= $this->getTotalReductionCartsAmount($orderShop) ; |
|
|
|
|
|
return $total ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getTotalReductionCartsAmount(OrderShopInterface $orderShop) |
|
|
|
|
|
{ |
|
|
$totalReductionAmount = 0 ; |
|
|
$totalReductionAmount = 0 ; |
|
|
foreach ($orderShop->getOrderReductionCarts() as $orderReductionCart) { |
|
|
foreach ($orderShop->getOrderReductionCarts() as $orderReductionCart) { |
|
|
$totalReductionAmount += $this->getOrderProductsReductionCartAmountWithoutTax($orderShop,$orderReductionCart); |
|
|
$totalReductionAmount += $this->getOrderProductsReductionCartAmountWithoutTax($orderShop,$orderReductionCart); |
|
|
} |
|
|
} |
|
|
|
|
|
return $totalReductionAmount ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getTotalReductionCreditsAmount(OrderShopInterface $orderShop) |
|
|
|
|
|
{ |
|
|
|
|
|
$totalReductionAmount = 0 ; |
|
|
foreach ($orderShop->getOrderReductionCredits() as $orderReductionCredit) { |
|
|
foreach ($orderShop->getOrderReductionCredits() as $orderReductionCredit) { |
|
|
$totalReductionAmount += $this->getOrderProductsReductionCreditAmountWithoutTax($orderShop,$orderReductionCredit); |
|
|
$totalReductionAmount += $this->getOrderProductsReductionCreditAmountWithoutTax($orderShop,$orderReductionCredit); |
|
|
} |
|
|
} |
|
|
|
|
|
return $totalReductionAmount ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$total -= $totalReductionAmount ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getTotalOrderProductsWithTaxAndReductions(OrderShopInterface $orderShop) |
|
|
|
|
|
{ |
|
|
|
|
|
$total = $this->getTotalOrderProductsWithTax($orderShop) ; |
|
|
|
|
|
$total -= $this->getTotalReductionCartsAmountWithTax($orderShop) ; |
|
|
|
|
|
$total -= $this->getTotalReductionCreditsAmountWithTax($orderShop) ; |
|
|
return $total ; |
|
|
return $total ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getTotalOrderProductsWithTaxAndReductions(OrderShopInterface $orderShop) |
|
|
|
|
|
|
|
|
public function getTotalOrderProductsWithTaxAndReductionCarts(OrderShopInterface $orderShop) |
|
|
{ |
|
|
{ |
|
|
$total = $this->getTotalOrderProductsWithTax($orderShop) ; |
|
|
$total = $this->getTotalOrderProductsWithTax($orderShop) ; |
|
|
|
|
|
$total -= $this->getTotalReductionCartsAmountWithTax($orderShop) ; |
|
|
|
|
|
return $total ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getTotalReductionCartsAmountWithTax(OrderShopInterface $orderShop) |
|
|
|
|
|
{ |
|
|
$totalReductionAmount = 0 ; |
|
|
$totalReductionAmount = 0 ; |
|
|
foreach ($orderShop->getOrderReductionCarts() as $orderReductionCart) { |
|
|
foreach ($orderShop->getOrderReductionCarts() as $orderReductionCart) { |
|
|
$totalReductionAmount += $this->getOrderProductsReductionCartAmountWithTax($orderShop,$orderReductionCart); |
|
|
$totalReductionAmount += $this->getOrderProductsReductionCartAmountWithTax($orderShop,$orderReductionCart); |
|
|
} |
|
|
} |
|
|
|
|
|
return $totalReductionAmount ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getTotalReductionCreditsAmountWithTax(OrderShopInterface $orderShop) |
|
|
|
|
|
{ |
|
|
|
|
|
$totalReductionAmount = 0 ; |
|
|
foreach ($orderShop->getOrderReductionCredits() as $orderReductionCredit) { |
|
|
foreach ($orderShop->getOrderReductionCredits() as $orderReductionCredit) { |
|
|
$totalReductionAmount += $this->getOrderProductsReductionCreditAmountWithTax($orderShop,$orderReductionCredit); |
|
|
$totalReductionAmount += $this->getOrderProductsReductionCreditAmountWithTax($orderShop,$orderReductionCredit); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$total -= $totalReductionAmount ; |
|
|
|
|
|
|
|
|
|
|
|
return $total ; |
|
|
|
|
|
|
|
|
return $totalReductionAmount ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getOrderProductsReductionCartAmountWithoutTax(OrderShopInterface $order, $orderReductionCart) |
|
|
public function getOrderProductsReductionCartAmountWithoutTax(OrderShopInterface $order, $orderReductionCart) |