Merge branch 'fixinvoice' into 'master'

fixed compare double values validation

See merge request CIEFWorldwideSdnBhd/exchange!157
This commit is contained in:
omair saleh
2020-09-29 04:30:01 +00:00
+2 -2
View File
@@ -100,7 +100,7 @@ class InvoiceController extends Controller
$billing_charges = $booking->billing_charge;
$total = $subtotal + $adjustment + $billing_charges;
if ($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
], 400);
@@ -227,7 +227,7 @@ class InvoiceController extends Controller
$billing_charges = $booking->billing_charge;
$total = $subtotal + $adjustment + $billing_charges;
if ($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
], 400);