Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange into too/registerpage

# Conflicts:
#	package-lock.json
#	package.json
#	vendor/composer/autoload_static.php
#	yarn.lock
This commit is contained in:
Jack Goh
2018-07-04 11:17:44 +08:00
40 changed files with 545 additions and 19775 deletions
+13 -1
View File
@@ -22,6 +22,7 @@ class BookingController extends Controller
$user = Auth::user();
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
->where('user_id', $user->id)
->orderby('updated_at','desc')
->paginate(10);
@@ -77,7 +78,8 @@ class BookingController extends Controller
public function adminIndex(){
$user = Auth::user();
$bookings = Booking::select('id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status')
->get();
->orderby('updated_at','desc')
->get();
// reformat to fit frontend structure
foreach ($bookings as $booking) {
@@ -522,6 +524,16 @@ class BookingController extends Controller
$term = $request->input('term');
$china_beneficiary = $request->input('china_beneficiary');
$rates = Rate::orderby('updated_at','desc')->first();
$creditLimit = SettingCredit::orderby('updated_at','desc')->first();
if (!$creditLimit){
return response()->json("Credit limit not set, please contact admin", 405);
}
if($amount > $creditLimit->rmb_credit_limit){
return response()->json(["message" => "Exceed credit limit, please contact our sales team for larger quantitiy"], 400);
}
// TODO : get marking
$marking = "123X";