mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/exchange into too/suppliersetting
This commit is contained in:
@@ -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) {
|
||||
@@ -524,6 +526,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";
|
||||
|
||||
@@ -29,7 +29,7 @@ class CreateUsersTable extends Migration
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
{
|
||||
Schema::drop('users');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,6 @@ class CreateRatesTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
Schema::dropIfExists('rates');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,14 @@ class CreateBookingsTable extends Migration
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
{
|
||||
Schema::table('bookings', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('bookings_rate_id_foreign');
|
||||
$table->dropColumn('rate_id');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('bookings');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@ class ChangeUserIdInBookingsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
Schema::table('bookings', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('bookings_user_id_foreign');
|
||||
$table->dropColumn('user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,11 +28,7 @@ class AddBookingsTable extends Migration
|
||||
$table->string('usd_book_swift_code')->default(' ');
|
||||
$table->string('usd_book_cnap')->default(' ');
|
||||
$table->string('usd_book_bank_branch')->default(' ');
|
||||
$table->boolean('verification_status')->default('1'); // Results in a default value of 1.
|
||||
|
||||
// $table->foreign('status_id')
|
||||
// ->references('id')->on('status')
|
||||
// ->onDelete('cascade');
|
||||
$table->boolean('verification_status')->default('1');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -43,8 +39,6 @@ class AddBookingsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,11 +28,7 @@ class MakeNullableFieldBookingsTable extends Migration
|
||||
$table->string('usd_book_swift_code')->nullable()->change();
|
||||
$table->string('usd_book_cnap')->nullable()->change();
|
||||
$table->string('usd_book_bank_branch')->nullable()->change();
|
||||
$table->boolean('verification_status')->nullable()->change(); // Results in a default value of 1.
|
||||
|
||||
// $table->foreign('status_id')
|
||||
// ->references('id')->on('status')
|
||||
// ->onDelete('cascade');
|
||||
$table->boolean('verification_status')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,11 @@ class CreateUserBankSlipsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('user_bank_slips', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('user_bank_slips_book_id_foreign');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('user_bank_slips');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,11 @@ class CreatePurchaseOrdersTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('purchase_orders', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('purchase_orders_booking_id_foreign');
|
||||
$table->dropColumn('booking_id');
|
||||
});
|
||||
Schema::dropIfExists('purchase_orders');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ class CreateMarkingTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('marking');
|
||||
Schema::dropIfExists('markings');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,12 @@ class CreateInvoiceTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('invoices', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('invoices_booking_id_foreign');
|
||||
$table->dropColumn('booking_id');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('invoices');
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -27,6 +27,10 @@ class AddBookingidForeignkeyToChinabankslipTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('china_bank_slips', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('china_bank_slips_booking_id_foreign');
|
||||
$table->dropColumn('booking_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item dropdown">
|
||||
<!-- <li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{ locales[locale] }}
|
||||
@@ -12,7 +12,7 @@
|
||||
{{ value }}
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</li> -->
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li v-if="(user && role == 'admin')" class="nav-item">
|
||||
<el-popover placement="top" width="300" v-model="UpdateRatePopoverVisible">
|
||||
@@ -27,9 +27,9 @@
|
||||
<a class="nav-link" href="#" role="button" slot="reference">Update Rate</a>
|
||||
</el-popover>
|
||||
</li></ul>
|
||||
<li v-if="(user && role == 'admin')" class="nav-item"><router-link :to="{ name: 'admin.complete' }" class="nav-link">{{ $t('Complete Order') }}</router-link></li>
|
||||
<!-- <li v-if="(user && role == 'admin')" class="nav-item"><router-link :to="{ name: 'admin.complete' }" class="nav-link">{{ $t('Complete Order') }}</router-link></li> -->
|
||||
<li v-if="(user && role == 'admin')" class="nav-item"><router-link :to="{ name: 'admin.transaction-history' }" class="nav-link">{{ $t('Transaction History') }}</router-link></li>
|
||||
<li v-if="(user && role == 'admin')" class="nav-item"><router-link :to="{ name: 'admin.upload-supplier-bank-slip' }" class="nav-link">{{ $t('Upload Supplier Bank Slip to System') }}</router-link></li>
|
||||
<!-- <li v-if="(user && role == 'admin')" class="nav-item"><router-link :to="{ name: 'admin.upload-supplier-bank-slip' }" class="nav-link">{{ $t('Upload Supplier Bank Slip to System') }}</router-link></li> -->
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -474,6 +474,12 @@ export default {
|
||||
this.dialogFormVisible1 = true
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: error.response.data.message,
|
||||
type: 'error',
|
||||
duration: 10000
|
||||
});
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user