From 1ee5b6952fb5f18bf2cb6a27bfc06a3033e1aa19 Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Wed, 15 Aug 2018 15:21:55 +0800 Subject: [PATCH 01/21] added bank name to bank setting select label --- .../assets/js/pages/settings/admin-bank-setting.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/resources/assets/js/pages/settings/admin-bank-setting.vue b/resources/assets/js/pages/settings/admin-bank-setting.vue index 7666ba77..1cf54289 100644 --- a/resources/assets/js/pages/settings/admin-bank-setting.vue +++ b/resources/assets/js/pages/settings/admin-bank-setting.vue @@ -3,8 +3,7 @@

Bank Setting


- Active CIEF bank account for today : - X1 : + Active Bank Account for X1: +
- X2 : + Active Bank Account for X1: X2 : - Active CIEF China Beneficiary Account for Today : + Active China Beneficiary Account: +
Update @@ -74,7 +75,7 @@ export default { this.options_CIEF = malaysiaBankData.map(function(item){ return { value : item.id, - label : item.acc_no, + label : item.company_name + " - " + item.acc_no, }; }); }) @@ -96,7 +97,7 @@ export default { this.options_china_bank = chinaBankData.map(function(item){ return { value : item.id, - label : item.acc_no, + label : item.company_name + " - " + item.acc_no, }; }); this.options_china_bank.unshift({ From 3c88ea09d3b7dd4974a29ef5b776382413e44a6b Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Wed, 15 Aug 2018 16:03:38 +0800 Subject: [PATCH 02/21] fix active bank save error removed phpmyadmin proxy from caddyfile --- caddy/Caddyfile | 1 - ...reight_from_setting_active_banks_table.php | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2018_08_15_154652_remove_foreight_from_setting_active_banks_table.php diff --git a/caddy/Caddyfile b/caddy/Caddyfile index eaf1b056..e4f1b0d1 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -1,5 +1,4 @@ https://exchange-staging.izyim.com { - proxy /phpmyadmin 127.0.0.1:8090 root /var/www/public fastcgi / 127.0.0.1:9000 php { diff --git a/database/migrations/2018_08_15_154652_remove_foreight_from_setting_active_banks_table.php b/database/migrations/2018_08_15_154652_remove_foreight_from_setting_active_banks_table.php new file mode 100644 index 00000000..d6ffe132 --- /dev/null +++ b/database/migrations/2018_08_15_154652_remove_foreight_from_setting_active_banks_table.php @@ -0,0 +1,32 @@ +dropForeign('setting_active_banks_beneficiary_id_foreign'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('setting_active_banks', function (Blueprint $table) { + // + }); + } +} From 7b1541a57f3933e0e61afa2aea04539d91a253c3 Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Wed, 15 Aug 2018 16:36:41 +0800 Subject: [PATCH 03/21] fix typo --- resources/assets/js/pages/settings/admin-bank-setting.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/pages/settings/admin-bank-setting.vue b/resources/assets/js/pages/settings/admin-bank-setting.vue index 1cf54289..c1e82cda 100644 --- a/resources/assets/js/pages/settings/admin-bank-setting.vue +++ b/resources/assets/js/pages/settings/admin-bank-setting.vue @@ -15,7 +15,7 @@
- Active Bank Account for X1: X2 : + Active Bank Account for X2 : Date: Wed, 15 Aug 2018 16:38:03 +0800 Subject: [PATCH 04/21] updated with no service charge --- app/Http/Controllers/BookingController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 4ffb1434..49aee280 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -453,7 +453,8 @@ class BookingController extends Controller if ($amount >= 10000 && ($term == 'x2_cash' || $term == 'x2_cheque' || $term == 'x2_ba')) { $svcharge = 0; } else { - $svcharge = 20.00; + //$svcharge = 20.00; + $svcharge = 0; // UPDATE ON : 15-8-2018 from PM } $subtotal = round(($amount + $svcharge) / $rate, 2); @@ -780,7 +781,8 @@ class BookingController extends Controller if ($amount >= 10000 && ($term == 'x2_cash' || $term == 'x2_cheque' || $term == 'x2_ba')) { $svcharge = 0; } else { - $svcharge = 20.00; + //$svcharge = 20.00; + $svcharge = 0; // UPDATE ON : 15-8-2018 from PM } $subtotal = round(($amount + $svcharge) / $rate,2); From 53ce807aeca9bc9a545c709cbffd86f46ea61a3c Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Wed, 15 Aug 2018 16:58:34 +0800 Subject: [PATCH 05/21] remove v-validate from admin malaysia bank setting --- .../js/pages/settings/admin-malaysia-bank.vue | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/assets/js/pages/settings/admin-malaysia-bank.vue b/resources/assets/js/pages/settings/admin-malaysia-bank.vue index ebf2f3ad..78f7b7a1 100644 --- a/resources/assets/js/pages/settings/admin-malaysia-bank.vue +++ b/resources/assets/js/pages/settings/admin-malaysia-bank.vue @@ -23,31 +23,31 @@ - + - + - + - + - + - + - + @@ -70,31 +70,31 @@ - + - + - + - + - + - + - + From 1d41c651b9195cd526fe44f29ba551826650ec62 Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Wed, 15 Aug 2018 17:02:19 +0800 Subject: [PATCH 06/21] removed some required field on malaysia bank field --- resources/assets/js/pages/settings/admin-malaysia-bank.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/pages/settings/admin-malaysia-bank.vue b/resources/assets/js/pages/settings/admin-malaysia-bank.vue index 78f7b7a1..99909455 100644 --- a/resources/assets/js/pages/settings/admin-malaysia-bank.vue +++ b/resources/assets/js/pages/settings/admin-malaysia-bank.vue @@ -53,7 +53,7 @@
Cancel - OK + OK
* Please key in the data in Chinese @@ -100,7 +100,7 @@
Cancel - Submit + Submit
* Please key in the data in Chinese From 0e5ed8f7f61be658c6134d3c8a07165a2b70780e Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Wed, 15 Aug 2018 17:06:31 +0800 Subject: [PATCH 07/21] removed v-validate updated some required field to non required field --- .../js/pages/settings/admin-china-bank.vue | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/resources/assets/js/pages/settings/admin-china-bank.vue b/resources/assets/js/pages/settings/admin-china-bank.vue index 9509fff1..57514377 100644 --- a/resources/assets/js/pages/settings/admin-china-bank.vue +++ b/resources/assets/js/pages/settings/admin-china-bank.vue @@ -23,37 +23,37 @@ - + - + - + - + - + - + - +
Cancel - OK + OK
* Please key in the data in Chinese @@ -70,35 +70,35 @@ - + - + - + - + - + - + - +
Cancel - Submit + Submit
* Please key in the data in Chinese From 6e9f2b2d10273763632cde44d88ecf236196764b Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Wed, 15 Aug 2018 17:07:25 +0800 Subject: [PATCH 08/21] removed "please key in the data in chinese" label in footer --- resources/assets/js/pages/settings/admin-china-bank.vue | 3 --- resources/assets/js/pages/settings/admin-malaysia-bank.vue | 3 --- 2 files changed, 6 deletions(-) diff --git a/resources/assets/js/pages/settings/admin-china-bank.vue b/resources/assets/js/pages/settings/admin-china-bank.vue index 57514377..1c960e49 100644 --- a/resources/assets/js/pages/settings/admin-china-bank.vue +++ b/resources/assets/js/pages/settings/admin-china-bank.vue @@ -55,9 +55,6 @@ Cancel OK - - * Please key in the data in Chinese -
Data Added Successfully

diff --git a/resources/assets/js/pages/settings/admin-malaysia-bank.vue b/resources/assets/js/pages/settings/admin-malaysia-bank.vue index 99909455..6b340739 100644 --- a/resources/assets/js/pages/settings/admin-malaysia-bank.vue +++ b/resources/assets/js/pages/settings/admin-malaysia-bank.vue @@ -102,9 +102,6 @@ Cancel Submit - - * Please key in the data in Chinese -
Data Updated Successfully

From bc43a2ee1ed79d7aa7254944d35242daaaab801a Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Wed, 15 Aug 2018 17:10:18 +0800 Subject: [PATCH 09/21] removed "please key in the data in chinese" label --- resources/assets/js/pages/settings/admin-malaysia-bank.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/assets/js/pages/settings/admin-malaysia-bank.vue b/resources/assets/js/pages/settings/admin-malaysia-bank.vue index 6b340739..adf91f02 100644 --- a/resources/assets/js/pages/settings/admin-malaysia-bank.vue +++ b/resources/assets/js/pages/settings/admin-malaysia-bank.vue @@ -55,9 +55,6 @@ Cancel OK - - * Please key in the data in Chinese -
Data Added Successfully

From 232edde8e49299d5c1cf9f560b517f8cca97ad59 Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Thu, 16 Aug 2018 09:40:54 +0800 Subject: [PATCH 10/21] fix unauthorized booking access --- app/Http/Controllers/BookingController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 49aee280..4b3d1705 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -24,12 +24,12 @@ class BookingController extends Controller public function index(){ $user = Auth::user(); $bookings = Booking::select('user_id', 'id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status') - ->where('user_id', Auth::user()->id) ->where('status', '=', '6') ->orwhere('status', '=', '4') ->orwhere('status', '=', '3') ->orwhere('status', '=', '2') ->orwhere('status', '=', '1') + ->where('user_id', Auth::user()->id) ->orderby('updated_at','desc') ->paginate(10); From 7bbe69638c5693980462b2c200e9aaa22eb5a1cf Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Thu, 16 Aug 2018 09:52:40 +0800 Subject: [PATCH 11/21] fix unauthorized booking access --- app/Http/Controllers/BookingController.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 4b3d1705..27c6b625 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -24,12 +24,19 @@ class BookingController extends Controller public function index(){ $user = Auth::user(); $bookings = Booking::select('user_id', 'id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status') - ->where('status', '=', '6') - ->orwhere('status', '=', '4') - ->orwhere('status', '=', '3') - ->orwhere('status', '=', '2') - ->orwhere('status', '=', '1') + // ->where('status', '=', '6') + // ->orwhere('status', '=', '4') + // ->orwhere('status', '=', '3') + // ->orwhere('status', '=', '2') + // ->orwhere('status', '=', '1') ->where('user_id', Auth::user()->id) + ->where(function ($query) { + $query->where('status', '=', '6') + ->orwhere('status', '=', '4') + ->orwhere('status', '=', '3') + ->orwhere('status', '=', '2') + ->orwhere('status', '=', '1'); + }) ->orderby('updated_at','desc') ->paginate(10); From 117f2cdaee41b448c468b66bf4bb8a7d615ab5cd Mon Sep 17 00:00:00 2001 From: Mohd Arief Date: Thu, 16 Aug 2018 10:01:44 +0800 Subject: [PATCH 12/21] fixed the notification bug on importer side --- app/Http/Controllers/BookingController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 175b9b20..89cf1dc8 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -941,11 +941,11 @@ class BookingController extends Controller $booking->admin_status = 5; // upload china bankslip if($booking->save()){ - $userNotification = new Notification; - $userNotification->detail = "Supplier booking report for booking " . $booking->id . " is completed."; - $userNotification->link = "/booking/" . $booking->id . "/transfer"; - $userNotification->user_id = $booking->user_id; - $userNotification->save(); + // $userNotification = new Notification; + // $userNotification->detail = "Supplier booking report for booking " . $booking->id . " is completed."; + // $userNotification->link = "/booking/" . $booking->id . "/transfer"; + // $userNotification->user_id = $booking->user_id; + // $userNotification->save(); return response()->json(['message'=>"Success"],200); } } From f6bd74ed5ec7599025d7ade130e1cd537def0fe0 Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Thu, 16 Aug 2018 10:12:05 +0800 Subject: [PATCH 13/21] removed unused code --- app/Http/Controllers/BookingController.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 27c6b625..1135da04 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -24,11 +24,6 @@ class BookingController extends Controller public function index(){ $user = Auth::user(); $bookings = Booking::select('user_id', 'id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status') - // ->where('status', '=', '6') - // ->orwhere('status', '=', '4') - // ->orwhere('status', '=', '3') - // ->orwhere('status', '=', '2') - // ->orwhere('status', '=', '1') ->where('user_id', Auth::user()->id) ->where(function ($query) { $query->where('status', '=', '6') @@ -166,14 +161,13 @@ class BookingController extends Controller public function adminIndex(){ $user = Auth::user(); $bookings = Booking::select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status') - - ->where('admin_status', '=', '5') - ->orwhere('admin_status', '=', '4') - ->orwhere('admin_status', '=', '3') - ->orwhere('admin_status', '=', '2') - ->orwhere('admin_status', '=', '1') - ->orderby('updated_at','desc') - ->paginate(10); + ->where('admin_status', '=', '5') + ->orwhere('admin_status', '=', '4') + ->orwhere('admin_status', '=', '3') + ->orwhere('admin_status', '=', '2') + ->orwhere('admin_status', '=', '1') + ->orderby('updated_at','desc') + ->paginate(10); // reformat to fit frontend structure foreach ($bookings as $booking) { From 5bc4f5929d8ee48ae1b5b29fc6885600f8d96344 Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Thu, 16 Aug 2018 10:23:03 +0800 Subject: [PATCH 14/21] removed all notifications code --- .../Controllers/ChinaBankSlipController.php | 8 --- ..._08_16_101635_drop_notifications_table.php | 28 ++++++++ ...8_16_101737_create_notifications_table.php | 35 +++++++++ database/seeds/NotificationSeeder.php | 35 --------- resources/assets/js/components/Navbar.vue | 72 +++++++++---------- routes/api.php | 14 ++-- 6 files changed, 106 insertions(+), 86 deletions(-) create mode 100644 database/migrations/2018_08_16_101635_drop_notifications_table.php create mode 100644 database/migrations/2018_08_16_101737_create_notifications_table.php delete mode 100644 database/seeds/NotificationSeeder.php diff --git a/app/Http/Controllers/ChinaBankSlipController.php b/app/Http/Controllers/ChinaBankSlipController.php index 0ed406ed..e4cc5742 100644 --- a/app/Http/Controllers/ChinaBankSlipController.php +++ b/app/Http/Controllers/ChinaBankSlipController.php @@ -5,7 +5,6 @@ namespace App\Http\Controllers; use App\ChinaBankSlip; use App\Booking; use App\User; -use App\Notification; use Illuminate\Http\Request; use Illuminate\Support\Facades\Storage; use Validator; @@ -82,13 +81,6 @@ class ChinaBankSlipController extends Controller $booking->admin_status = 6; $booking->save(); - $userNotification = new Notification; - $userNotification->detail = "Your china bankslip for booking " . $booking->id . " is uploaded."; - $userNotification->link = "/booking/" . $booking->id . "/upload-po"; - $userNotification->user_id = $booking->user_id; - $userNotification->save(); - - return response()->json(["message"=> "Success"],200); } diff --git a/database/migrations/2018_08_16_101635_drop_notifications_table.php b/database/migrations/2018_08_16_101635_drop_notifications_table.php new file mode 100644 index 00000000..d0b458c2 --- /dev/null +++ b/database/migrations/2018_08_16_101635_drop_notifications_table.php @@ -0,0 +1,28 @@ +uuid('id')->primary(); + $table->string('type'); + $table->morphs('notifiable'); + $table->text('data'); + $table->timestamp('read_at')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('notifications'); + } +} diff --git a/database/seeds/NotificationSeeder.php b/database/seeds/NotificationSeeder.php deleted file mode 100644 index 316b11ad..00000000 --- a/database/seeds/NotificationSeeder.php +++ /dev/null @@ -1,35 +0,0 @@ -first(); - $admin = User::where("email", "admin@example.com")->first(); - - DB::table('notifications')->insert([ - 'detail' => 'This is an user seeder notification', - 'user_id' => $user->id, - 'link' => '/', - 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), - 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'), - ]); - - DB::table('notifications')->insert([ - 'detail' => 'This is an admin seeder notification', - 'user_id' => $admin->id, - 'link' => '/', - 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), - 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'), - ]); - } -} diff --git a/resources/assets/js/components/Navbar.vue b/resources/assets/js/components/Navbar.vue index 7f32c3c2..e7d999fe 100644 --- a/resources/assets/js/components/Navbar.vue +++ b/resources/assets/js/components/Navbar.vue @@ -6,7 +6,7 @@