mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
TBD calculation feature
updated bookingconfirmationTable frontend
This commit is contained in:
@@ -35,10 +35,10 @@ class BookingController extends Controller
|
||||
$rate = $rates->x2_ba;
|
||||
break;
|
||||
default:
|
||||
return Response::json(array(
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Invalid input',
|
||||
), 422);
|
||||
], 422);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -117,4 +117,51 @@ class BookingController extends Controller
|
||||
}
|
||||
|
||||
// TODO : cancel booking feature
|
||||
|
||||
|
||||
// TODO : get calculation
|
||||
|
||||
public function calculation(Request $request){
|
||||
$amount = $request->input('amount');
|
||||
$term = $request->input('term');
|
||||
$rates = Rate::all()->last();
|
||||
|
||||
switch ($term) {
|
||||
case "x1_cash":
|
||||
$rate = $rates->x1_cash;
|
||||
break;
|
||||
case "x1_cheque":
|
||||
$rate = $rates->x1_cheque;
|
||||
break;
|
||||
case "x1_ba":
|
||||
$rate = $rates->x1_ba;
|
||||
break;
|
||||
case "x2_cash":
|
||||
$rate = $rates->x2_cash;
|
||||
break;
|
||||
case "x2_cheque":
|
||||
$rate = $rates->x2_cheque;
|
||||
break;
|
||||
case "x2_ba":
|
||||
$rate = $rates->x2_ba;
|
||||
break;
|
||||
default:
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Invalid input',
|
||||
], 422);
|
||||
break;
|
||||
}
|
||||
return $rate;
|
||||
|
||||
// order number
|
||||
// date
|
||||
// customer marking
|
||||
// payment method
|
||||
// CNY RMB
|
||||
|
||||
// Service charge
|
||||
// Rate
|
||||
// Total before GST
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user