Explorar el Código

Processus de commande

feature/export_comptable
Fab hace 4 años
padre
commit
4d31e094bf
Se han modificado 2 ficheros con 5 adiciones y 3 borrados
  1. +2
    -3
      ShopBundle/Services/Price/OrderShopPriceUtils.php
  2. +3
    -0
      ShopBundle/Services/Price/PriceUtilsTrait.php

+ 2
- 3
ShopBundle/Services/Price/OrderShopPriceUtils.php Ver fichero

@@ -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 Ver fichero

@@ -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
{

Cargando…
Cancelar
Guardar