update get caluclation for booking

This commit is contained in:
Jack Goh
2018-06-18 11:00:00 +08:00
parent 3d7016281b
commit 857b9c5fde
2 changed files with 90 additions and 76 deletions
+7 -3
View File
@@ -229,6 +229,7 @@ class BookingController extends Controller
public function calculation(Request $request){
$amount = $request->input('amount');
$term = $request->input('term');
$china_beneficiary = $request->input('china_beneficiary');
$rates = Rate::all()->last();
// TODO : get marking
@@ -274,13 +275,16 @@ class BookingController extends Controller
}
$bankin_amount = round(($amount + $svcharge) / $rate + (0 * ($amount + $svcharge)), 2);
return response()->json([
'customer_marking' => $marking,
'date' => date('Y-m-d'),
'marking' => $marking,
'amount' => $amount,
'payment_method' => $payment_method,
'service_charge' => $svcharge,
'rate' => $rate,
'bankin_amount' => $bankin_amount
'bankin_amount' => $bankin_amount,
'china_beneficary' => $china_beneficiary
], 200);
}
}