mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 12:24:09 +00:00
fix conflit
This commit is contained in:
@@ -19,47 +19,45 @@ class BookingController extends Controller
|
||||
{
|
||||
$rates = Rate::all()->last();
|
||||
$term = $request->input('term');
|
||||
$rate = 1;
|
||||
|
||||
switch($term){
|
||||
$rate = 1; // default
|
||||
switch ($term) {
|
||||
case "x1_cash":
|
||||
$rate = $rates->x1_cash;
|
||||
$rate = $rates->x1_cash;
|
||||
break;
|
||||
case "x1_cheque":
|
||||
$rate = $rates->x1_cheque;
|
||||
$rate = $rates->x1_cheque;
|
||||
break;
|
||||
case "x1_ba":
|
||||
$rate = $rates->x1_ba;
|
||||
break;
|
||||
case "x2_cash":
|
||||
$rate = $rates->x2_cash;
|
||||
$rate = $rates->x2_cash;
|
||||
break;
|
||||
case "x2_cheque":
|
||||
$rate = $rates->x2_cheque;
|
||||
$rate = $rates->x2_cheque;
|
||||
break;
|
||||
case "x2_ba":
|
||||
$rate = $rates->x2_ba;
|
||||
break;
|
||||
default:
|
||||
|
||||
//$rate = "no";
|
||||
return Response::json(array(
|
||||
'code' => 422,
|
||||
'message' => 'Invalid input'
|
||||
return Response::json(array(
|
||||
'success' => false,
|
||||
'message' => 'Invalid input',
|
||||
), 422);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//Calculation part
|
||||
|
||||
// Calculation
|
||||
// Service charge
|
||||
$amount = $request->input("amount");
|
||||
|
||||
//logic : if amount higher than 10,000, no service charge. if amount lower than 10,000, 20.00 service charge
|
||||
if ($amount >= 10000 && ($term == 'x2_cash' || $term = 'x2_cheque' || $term = 'x2_ba')) {
|
||||
$svcharge = 0;
|
||||
} else {
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
else {
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
|
||||
//initial calculation
|
||||
$RMBinMYR = (($amount + $svcharge) / $rate);
|
||||
@@ -240,8 +238,9 @@ class BookingController extends Controller
|
||||
|
||||
public function delete(Booking $book_id)
|
||||
{
|
||||
$book_id->delete($book_id);
|
||||
|
||||
$booking->delete($book_id);
|
||||
return response()->json($book_id, 204);
|
||||
}
|
||||
|
||||
// TODO : cancel booking feature
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user