priceSolver = $priceSolver; $this->orderShopSolver = $orderShopSolver; } public function getTotalRemainingToBePaid(OrderShopInterface $orderShop): float { return $this->priceSolver->getTotalWithTax($orderShop) - $this->orderShopSolver->getTotalOrderPayments( $orderShop ); } // isOrderShopPositiveAmount public function isPositiveAmount(OrderShopInterface $orderShop): bool { return $this->priceSolver->getTotalWithTax($orderShop) >= 0; } public function isPaid(OrderShopInterface $orderShop, $mergeComplementaryOrderShop = false): bool { $totalOrderPayments = $this->orderShopSolver->getTotalOrderPayments($orderShop, $mergeComplementaryOrderShop); $totalOrder = $this->priceSolver->getTotalWithTax($orderShop); if ((abs($totalOrderPayments - $totalOrder) < 0.00001 || $totalOrderPayments >= $totalOrder) && $totalOrder > 0) { return true; } else { return false; } } // isOrderShopPositiveAmountRemainingToBePaid public function isPositiveAmountRemainingToBePaid(OrderShopInterface $orderShop): bool { return $this->getTotalRemainingToBePaid($orderShop) > 0; } }