Переглянути джерело

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/LcShopBundle into develop

feature/export_comptable
Fab 4 роки тому
джерело
коміт
16380e99d1
2 змінених файлів з 14 додано та 5 видалено
  1. +13
    -4
      ShopBundle/Services/Price/OrderShopPriceUtils.php
  2. +1
    -1
      ShopBundle/Services/Price/PriceUtils.php

+ 13
- 4
ShopBundle/Services/Price/OrderShopPriceUtils.php Переглянути файл

@@ -31,20 +31,29 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface
}

public function getTotalOrderProductsWithTax(OrderShopInterface $orderShop):float
{
return $this->getTotalOrderProductsWithTaxByOrderProducts($orderShop->getOrderProducts()) ;
}

public function getTotalOrderProductsWithTaxByOrderProducts($orderProducts):float
{
$total = 0;
foreach ($orderShop->getOrderProducts() as $orderProduct) {
foreach ($orderProducts as $orderProduct) {
$total += $this->orderProductPriceUtils->getTotalWithTaxAndReduction($orderProduct);
}

return $total;

}


public function getTotalOrderProductsTaxes(OrderShopInterface $orderShop):float
{
return 0 ;
$total = 0 ;

foreach($orderShop->getOrderProducts() as $orderProduct) {
$total += $this->orderProductPriceUtils->getTotalTaxes($orderProduct) / $this->getReductionsCoef($orderShop) ;
}

return $total ;
}

public function getOrderProductsTaxesAsArray(OrderShopInterface $orderShop):array

+ 1
- 1
ShopBundle/Services/Price/PriceUtils.php Переглянути файл

@@ -34,7 +34,7 @@ class PriceUtils implements PriceUtilsInterface
$service = 'orderProductPriceUtils' ;
}

if($entity instanceof OrderShopInterface) {
if($entity instanceof OrderShopInterface || is_array($entity)) {
$service = 'orderShopPriceUtils' ;
}


Завантаження…
Відмінити
Зберегти