From f5d7da493c0961c1fca1cfc174cd50dd43198626 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 11 Oct 2021 16:33:21 +0800 Subject: [PATCH] fix bug with balance payment by rounding up to 2 decimal --- .../Bookings/ControllersLogic/CreateBookingPaymentLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php index b2a0732a..df2a7960 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingPaymentLogic.php @@ -80,7 +80,7 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic $outstanding = $this->calculatesBookingOutstanding->execute($booking); - if($conversionObject->getAmount() > $outstanding) throw new MalformedRequestException('Your payment must not be greater than '. $outstanding .'.'); + if($conversionObject->getAmount() > round($outstanding, 2)) throw new MalformedRequestException('Your payment must not be greater than '. $outstanding .'.'); $configurations = $this->fetchBookingQuotation->execute($booking->company, $conversionObject);