From 97fc1c9bd7ccb3c42ab7c5d48fcd4c251eecb724 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 29 Sep 2020 17:33:15 +0800 Subject: [PATCH] fix bug with amount not matching --- app/Http/Controllers/InvoiceController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 17a63cfd..7e9360a4 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -102,9 +102,12 @@ class InvoiceController extends Controller if (abs($total-$booking->bia) > 0.01) { return response()->json([ - 'message' => 'Booking amount expected is '.$booking->bia.'. Your Invoice amount is '.$total.' '.PHP_FLOAT_EPSILON + 'message' => 'Booking amount expected is '.$booking->bia.'. Your Invoice amount is '.$total ], 400); } + return response()->json([ + 'message' => 'successful' + ], 400); // Write to database if does not exist $exist = Invoice::where('booking_id', $id)->first();