From 89d13924fc80556a545b3f5de5264b24b18c8465 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 29 Sep 2020 17:19:26 +0800 Subject: [PATCH] fix bug with amount not matching --- app/Http/Controllers/InvoiceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 3ea44d5f..141ad477 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -99,7 +99,7 @@ class InvoiceController extends Controller $adjustment = $request->adjustment; $billing_charges = $booking->billing_charge; $total = $subtotal + $adjustment + $billing_charges; -echo dd(abs($total-$booking->bia)); + if (abs($total-$booking->bia) < PHP_FLOAT_EPSILON) { return response()->json([ 'message' => 'Booking amount expected is '.$booking->bia.'. Your Invoice amount is '.$total