mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 12:24:09 +00:00
booking controller update
This commit is contained in:
@@ -15,10 +15,10 @@ class BookingController extends Controller
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return response()->json(['success' => true, 'message'=> "You have successfully logged out."]);
|
||||
}
|
||||
//public function index()
|
||||
//{
|
||||
// return response()->json(['success' => true, 'message'=> "You have successfully logged out."]);
|
||||
//}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
@@ -27,7 +27,7 @@ class BookingController extends Controller
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return response()->json(['success' => true, 'message'=> "Hohohoho"]);
|
||||
return response()->json(['success' => true, 'message'=> "Success"]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,14 +62,19 @@ class BookingController extends Controller
|
||||
$rate = $rates->x2_ba;
|
||||
break;
|
||||
default:
|
||||
$rate = "no";
|
||||
|
||||
//$rate = "no";
|
||||
return Response::json(array(
|
||||
'code' => 404,
|
||||
'message' => 'no term found'
|
||||
), 404);
|
||||
break;
|
||||
}
|
||||
|
||||
//Calculation part
|
||||
// $bookings = Booking::all();
|
||||
$amount = $request->input("amount");
|
||||
|
||||
;
|
||||
if ($amount >= 10000 && ($term == 'x2_cash' || $term = 'x2_cheque' || $term = 'x2_ba')) {
|
||||
$svcharge = 0;
|
||||
}
|
||||
@@ -77,7 +82,9 @@ class BookingController extends Controller
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
|
||||
$bia = round(($amount + ($svcharge / $rate) + 0.06), 2);
|
||||
$bia = round(($amount + $svcharge) / $rate + (0*($amount + $svcharge)), 2);
|
||||
//gst = 0.00% -> (0*($amount + $svcharge))
|
||||
//bia = bank in amount in MYR
|
||||
|
||||
// return $bia;
|
||||
$user = Auth::user();
|
||||
@@ -94,6 +101,22 @@ class BookingController extends Controller
|
||||
$booking->term = $request->input('term');
|
||||
$booking->amount = $request->input('amount');
|
||||
$booking->rate_id = $rate;
|
||||
|
||||
$booking->rmb_book_amount = $request->input('rmb_book_amount');
|
||||
$booking->rmb_book_pay_method = $request->input('rmb_book_pay_method');
|
||||
$booking->rmb_book_account_name = $request->input('rmb_book_account_name');
|
||||
$booking->rmb_book_acc_no = $request->input('rmb_book_acc_no');
|
||||
$booking->rmb_book_bank_branch = $request->input('rmb_book_bank_branch');
|
||||
|
||||
$booking->usd_book_amount = $request->input('usd_book_amount');
|
||||
$booking->usd_book_pay_method = $request->input('usd_book_pay_method');
|
||||
$booking->usd_book_company_name = $request->input('usd_book_company_name');
|
||||
$booking->usd_book_company_address = $request->input('usd_book_company_address');
|
||||
$booking->usd_book_swift_code = $request->input('usd_book_swift_code');
|
||||
$booking->usd_book_cnap = $request->input('usd_book_cnap');
|
||||
$booking->usd_book_bank_branch = $request->input('usd_book_bank_branch');
|
||||
$booking->verification_status = $request->input('verification_status');
|
||||
|
||||
$booking->user()->associate($user);
|
||||
//$booking->user_id = $request->input('user_id');
|
||||
$booking->bia = $bia;
|
||||
@@ -111,11 +134,11 @@ class BookingController extends Controller
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//public function show($id)
|
||||
//{
|
||||
// $booking = Booking::find($id);
|
||||
return view('booking.index');
|
||||
}
|
||||
// return view('booking.index');
|
||||
//}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
@@ -123,10 +146,10 @@ class BookingController extends Controller
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//public function edit($id)
|
||||
//{
|
||||
//
|
||||
}
|
||||
//}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
|
||||
Reference in New Issue
Block a user