|
|
@@ -58,7 +58,7 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface |
|
|
|
return $total; |
|
|
|
} |
|
|
|
|
|
|
|
public function getMarginOrderProductsPercent(OrderShopInterface $orderShop): float |
|
|
|
public function getMarginOrderProductsWithReductionsPercent(OrderShopInterface $orderShop): float |
|
|
|
{ |
|
|
|
if ($this->getTotalOrderProducts($orderShop)) { |
|
|
|
return $this->round($this->getMarginOrderProductsWithReductions($orderShop) / $this->getTotalOrderProductsWithReductions($orderShop) * 100); |
|
|
@@ -67,7 +67,7 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function getMarginOrderProductsWithReductionsPercent(OrderShopInterface $orderShop): float |
|
|
|
public function getMarginOrderProductsPercent(OrderShopInterface $orderShop): float |
|
|
|
{ |
|
|
|
if ($this->getTotalOrderProducts($orderShop)) { |
|
|
|
return $this->round($this->getMarginOrderProducts($orderShop) / $this->getTotalOrderProducts($orderShop) * 100); |
|
|
@@ -76,11 +76,31 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function getBrandTaxesOrderProductsWithReductionsPercent(OrderShopInterface $orderShop): float |
|
|
|
{ |
|
|
|
if ($this->getTotalOrderProducts($orderShop)) { |
|
|
|
return $this->round($this->getMarginOrderProducts($orderShop) / $this->getTotalBuyingPriceOrderProducts($orderShop->getOrderProducts()) * 100); |
|
|
|
} else { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function getTotalOrderProductsWithTax(OrderShopInterface $orderShop): float |
|
|
|
{ |
|
|
|
return $this->getTotalOrderProductsWithTaxByOrderProducts($orderShop->getOrderProducts()); |
|
|
|
} |
|
|
|
|
|
|
|
public function getTotalBuyingPriceOrderProducts($orderProducts): float |
|
|
|
{ |
|
|
|
$total = 0; |
|
|
|
|
|
|
|
foreach ($orderProducts as $orderProduct) { |
|
|
|
$total += $this->orderProductPriceUtils->getTotalBuyingPrice($orderProduct); |
|
|
|
} |
|
|
|
|
|
|
|
return $total; |
|
|
|
} |
|
|
|
|
|
|
|
public function getTotalBuyingPriceOrderProductsWithTax($orderProducts): float |
|
|
|
{ |
|
|
|
$total = 0; |
|
|
@@ -280,5 +300,15 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface |
|
|
|
|
|
|
|
return $amountWithTax; |
|
|
|
} |
|
|
|
|
|
|
|
public function getTotalReductions() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public function getTotalReductionsWithTax() |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|