From 27412aec138530529808f2fda3769c62260b0a41 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 29 Sep 2020 17:21:50 +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 a7765b0f..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; -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