fix user booking calculation

This commit is contained in:
Jack Goh
2018-07-26 12:26:34 +08:00
parent 4ae97df8c5
commit a06f57712d
+18 -3
View File
@@ -595,9 +595,24 @@ class BookingController extends Controller
$svcharge = 20.00;
}
$subtotal = round($amount + $svcharge / $rate,2);
$taxAmount = round($subtotal * $taxrate,2);
$billingChargeAmount = round(($amount + $svcharge) * $billingChargeRate, 2);
$subtotal = round(($amount + $svcharge) / $rate,2);
// TODO : refactor
if ($taxrate !=0){
$taxAmount = round($subtotal * $taxrate - $subtotal,2);
}
else{
$taxAmount = 0;
}
if ($billingChargeRate !=0){
$billingChargeAmount = round(($amount + $svcharge) * $billingChargeRate - ($amount + $svcharge), 2);
}
else{
$billingChargeAmount = 0;
}
$billingChargeAmount = round((($amount / $rate) * $billingChargeRate) - ($amount / $rate), 2);
$bankin_amount = round($subtotal + $taxAmount + $billingChargeAmount , 2);
return response()->json([