Bladeren bron

Processus de commande

feature/export_comptable
Fab 4 jaren geleden
bovenliggende
commit
29570e2a08
1 gewijzigde bestanden met toevoegingen van 55 en 24 verwijderingen
  1. +55
    -24
      ShopBundle/Services/Price/OrderShopPriceUtils.php

+ 55
- 24
ShopBundle/Services/Price/OrderShopPriceUtils.php Bestand weergeven

@@ -77,6 +77,9 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface

public function getTotalOrderProductsWithReductions(OrderShopInterface $orderShop)
{
foreach ($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$reductionAmount = $this->amountOrderProductsReductionCart($orderShop,$orderReductionCart);
}

}

@@ -86,38 +89,66 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface

}

public function applyOrderProductsReductionCart(OrderShopInterface $order, $withTax = true)
public function amountOrderProductsReductionCart(OrderShopInterface $order, $orderReductionCart)
{

foreach ($order->getOrderReductionCarts() as $orderReductionCart) {
if($orderReductionCart->getAppliedTo() === ReductionCart::APPLIED_TO_ORDER_PRODUCTS) {
if ($orderReductionCart->getUnit() == 'percent') {

$priceWithTax = $this->applyReductionPercent(
$this->getTotalOrderProductsWithTax($order),
$orderReductionCart->getValue
if($orderReductionCart->getAppliedTo() === ReductionCart::APPLIED_TO_ORDER_PRODUCTS) {
if ($orderReductionCart->getUnit() == 'percent') {

$priceWithTax = $this->applyReductionPercent(
$this->getTotalOrderProductsWithTax($order),
$orderReductionCart->getValue
);
} else if ($orderReductionCart->getUnit() == 'amount') {
if ($orderReductionCart->getBehaviorTaxRate() == 'tax-excluded') {
$priceWithTax = $this->applyTax(
$this->applyReductionAmount(
$this->getTotalOrderProducts($order),
$orderReductionCart->getValue()
),
$this->getTaxRateAverage($order)
);
} else if ($orderReductionCart->getUnit() == 'amount') {
if ($orderReductionCart->getBehaviorTaxRate() == 'tax-excluded') {
$priceWithTax = $this->applyTax(
$this->applyReductionAmount(
$this->getTotalOrderProducts($order),
$orderReductionCart->getValue()
),
$this->getTaxRateAverage($order)
} else if ($orderReductionCart->getBehaviorTaxRate() == 'tax-included') {
$priceWithTax =
$this->applyReductionAmount(
$this->getTotalOrderProductsWithTax($order),
$orderReductionCart->getValue()
);
} else if ($orderReductionCart->getBehaviorTaxRate() == 'tax-included') {
$priceWithTax =
$this->applyReductionAmount(
$this->getTotalOrderProductsWithTax($order),
$orderReductionCart->getValue()
);

}

}
}
}
}

public function amountOrderProductsReductionCredit(OrderShopInterface $order, $orderReductionCart)
{


if ($orderReductionCart->getUnit() == 'percent') {

$priceWithTax = $this->applyReductionPercent(
$this->getTotalOrderProductsWithTax($order),
$orderReductionCart->getValue
);
} else if ($orderReductionCart->getUnit() == 'amount') {
if ($orderReductionCart->getBehaviorTaxRate() == 'tax-excluded') {
$priceWithTax = $this->applyTax(
$this->applyReductionAmount(
$this->getTotalOrderProducts($order),
$orderReductionCart->getValue()
),
$this->getTaxRateAverage($order)
);
} else if ($orderReductionCart->getBehaviorTaxRate() == 'tax-included') {
$priceWithTax =
$this->applyReductionAmount(
$this->getTotalOrderProductsWithTax($order),
$orderReductionCart->getValue()
);

}
}
}
}

}

Laden…
Annuleren
Opslaan