Browse Source

Processus de commande

feature/export_comptable
Fab 4 years ago
parent
commit
4d31e094bf
2 changed files with 5 additions and 3 deletions
  1. +2
    -3
      ShopBundle/Services/Price/OrderShopPriceUtils.php
  2. +3
    -0
      ShopBundle/Services/Price/PriceUtilsTrait.php

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

@@ -95,8 +95,7 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface

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

$price = $this->applyReductionPercent(
$price = $this->amountReductionByPercentValue(
$this->getTotalOrderProducts($order),
$orderReductionCart->getValue()
);
@@ -117,7 +116,7 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface
if($orderReductionCart->getAppliedTo() === ReductionCart::APPLIED_TO_ORDER_PRODUCTS) {
if ($orderReductionCart->getUnit() == 'percent') {

$price = $this->applyReductionPercent(
$price = $this->amountReductionByPercentValue(
$this->getTotalOrderProductsWithTax($order),
$orderReductionCart->getValue()
);

+ 3
- 0
ShopBundle/Services/Price/PriceUtilsTrait.php View File

@@ -37,6 +37,9 @@ trait PriceUtilsTrait
{
return round((($price * 100)) / 100, 2);
}
public function amountReductionByPercentValue($price, $percent){
return round((($price * $percent)) / 100, 2);
}

public function applyReductionCatalog($entity, $price, $priceWithTax, $reductionCatalog = null, $withTax = true): ?float
{

Loading…
Cancel
Save