|
|
|
|
|
|
|
|
return $total; |
|
|
return $total; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getMarginOrderProductsPercent(OrderShopInterface $orderShop): float |
|
|
|
|
|
|
|
|
public function getMarginOrderProductsWithReductionsPercent(OrderShopInterface $orderShop): float |
|
|
{ |
|
|
{ |
|
|
if ($this->getTotalOrderProducts($orderShop)) { |
|
|
if ($this->getTotalOrderProducts($orderShop)) { |
|
|
return $this->round($this->getMarginOrderProductsWithReductions($orderShop) / $this->getTotalOrderProductsWithReductions($orderShop) * 100); |
|
|
return $this->round($this->getMarginOrderProductsWithReductions($orderShop) / $this->getTotalOrderProductsWithReductions($orderShop) * 100); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getMarginOrderProductsWithReductionsPercent(OrderShopInterface $orderShop): float |
|
|
|
|
|
|
|
|
public function getMarginOrderProductsPercent(OrderShopInterface $orderShop): float |
|
|
{ |
|
|
{ |
|
|
if ($this->getTotalOrderProducts($orderShop)) { |
|
|
if ($this->getTotalOrderProducts($orderShop)) { |
|
|
return $this->round($this->getMarginOrderProducts($orderShop) / $this->getTotalOrderProducts($orderShop) * 100); |
|
|
return $this->round($this->getMarginOrderProducts($orderShop) / $this->getTotalOrderProducts($orderShop) * 100); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
public function getTotalOrderProductsWithTax(OrderShopInterface $orderShop): float |
|
|
{ |
|
|
{ |
|
|
return $this->getTotalOrderProductsWithTaxByOrderProducts($orderShop->getOrderProducts()); |
|
|
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 |
|
|
public function getTotalBuyingPriceOrderProductsWithTax($orderProducts): float |
|
|
{ |
|
|
{ |
|
|
$total = 0; |
|
|
$total = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $amountWithTax; |
|
|
return $amountWithTax; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getTotalReductions() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getTotalReductionsWithTax() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|