Merge branch 'fixinvoice' into 'master'

changing epsilon float to 0.01

See merge request CIEFWorldwideSdnBhd/exchange!158
This commit is contained in:
omair saleh
2020-09-29 09:28:48 +00:00
+3 -3
View File
@@ -100,7 +100,7 @@ class InvoiceController extends Controller
$billing_charges = $booking->billing_charge;
$total = $subtotal + $adjustment + $billing_charges;
if (abs($total-$booking->bia) < PHP_FLOAT_EPSILON) {
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
], 400);
@@ -227,9 +227,9 @@ class InvoiceController extends Controller
$billing_charges = $booking->billing_charge;
$total = $subtotal + $adjustment + $billing_charges;
if (abs($total-$booking->bia) < PHP_FLOAT_EPSILON) {
if (abs($total-$booking->bia) > 0.01) {
return response()->json([
'message' => 'Booking amount expected is '.$booking->bia.'. Your Invoice amount is '.$total
'message' => 'Booking amount expected is '.gettype($booking->bia).'. Your Invoice amount is '.gettype($total)
], 400);
}