diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 5f8694b8..2d1a3858 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -21,6 +21,7 @@ class BookingController extends Controller { public function index(){ + return 123; $user = Auth::user(); $bookings = Booking::select('user_id', 'id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status') ->where('user_id', $user->id) @@ -77,73 +78,74 @@ 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') - ->orderby('updated_at','desc') - ->get(); + return 123; + // $user = Auth::user(); + // $bookings = Booking::select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status') + // ->orderby('updated_at','desc') + // ->get(); - // reformat to fit frontend structure - foreach ($bookings as $booking) { - // set timeout - $date1 = new DateTime($booking->created_at); - $date2 = new DateTime(); - $time_in_seconds = SettingCredit::orderby('updated_at','desc')->first()->time_limit; - $difference_in_seconds = ($date1->format('U') + $time_in_seconds) - ($date2->format('U')); - $booking->timeout = $difference_in_seconds; + // // reformat to fit frontend structure + // foreach ($bookings as $booking) { + // // set timeout + // $date1 = new DateTime($booking->created_at); + // $date2 = new DateTime(); + // $time_in_seconds = SettingCredit::orderby('updated_at','desc')->first()->time_limit; + // $difference_in_seconds = ($date1->format('U') + $time_in_seconds) - ($date2->format('U')); + // $booking->timeout = $difference_in_seconds; - // TODO : you can make it better - if($difference_in_seconds < 0 ){ - $booking->timeout = 0; - } + // // TODO : you can make it better + // if($difference_in_seconds < 0 ){ + // $booking->timeout = 0; + // } - // TODO : transfer_amount change name to bia - $booking->transfer_amount = $booking->bia; + // // TODO : transfer_amount change name to bia + // $booking->transfer_amount = $booking->bia; - $term = $booking->term; - if($term == "x1_ba" || $term == "x2_cheque"){ - $status = $booking->admin_status > 2 ? $booking->admin_status - 2 : $booking->admin_status; - $booking->track_status = "(". $status ."/5)"; - } - else{ - $booking->track_status = "(". $booking->admin_status ."/7)"; - } + // $term = $booking->term; + // if($term == "x1_ba" || $term == "x2_cheque"){ + // $status = $booking->admin_status > 2 ? $booking->admin_status - 2 : $booking->admin_status; + // $booking->track_status = "(". $status ."/5)"; + // } + // else{ + // $booking->track_status = "(". $booking->admin_status ."/7)"; + // } - switch ($booking->admin_status) { - case 1: - $status_desc = "Waiting customer upload bank slip"; - break; - case 2: - $status_desc = "Verify user bank slip"; - break; - case 3: - if($term !== "x1_ba" || $term !== "x2_cheque"){ - $status_desc = "Generate supplier booking report"; - break; - } - case 4: - if($term !== "x1_ba" || $term !== "x2_cheque"){ - $status_desc = "Supplier booking report. Please confirm with your booking."; - break; - } - case 5: - $status_desc = "Please, upload China Bankslip"; - break; - case 6: - $status_desc = "Waiting customer to upload purchase order"; - break; - case 7: - $status_desc = "Customer has uploaded purchase order, please upload invoice"; - break; - case 8: - $status_desc = "Booking Completed"; - break; - default: - $status_desc = ""; - } - $booking->marking = $booking->user->marking; - $booking->status_desc = $status_desc; - } - return $bookings; + // switch ($booking->admin_status) { + // case 1: + // $status_desc = "Waiting customer upload bank slip"; + // break; + // case 2: + // $status_desc = "Verify user bank slip"; + // break; + // case 3: + // if($term !== "x1_ba" || $term !== "x2_cheque"){ + // $status_desc = "Generate supplier booking report"; + // break; + // } + // case 4: + // if($term !== "x1_ba" || $term !== "x2_cheque"){ + // $status_desc = "Supplier booking report. Please confirm with your booking."; + // break; + // } + // case 5: + // $status_desc = "Please, upload China Bankslip"; + // break; + // case 6: + // $status_desc = "Waiting customer to upload purchase order"; + // break; + // case 7: + // $status_desc = "Customer has uploaded purchase order, please upload invoice"; + // break; + // case 8: + // $status_desc = "Booking Completed"; + // break; + // default: + // $status_desc = ""; + // } + // $booking->marking = $booking->user->marking; + // $booking->status_desc = $status_desc; + // } + // return $bookings; } public function show($id) @@ -785,23 +787,23 @@ class BookingController extends Controller } } - public function adminShowCompletedOrders() - { - $bookings = Booking::select('id','created_at','user_id','rate','amount', 'bia', 'admin_status') - ->where('admin_status', 7) - ->orderBy('id', 'desc') - ->get(); + // public function adminShowCompletedOrders() + // { + // $bookings = Booking::select('id','created_at','user_id','rate','amount', 'bia', 'admin_status') + // ->where('admin_status', 7) + // ->orderBy('id', 'desc') + // ->get(); - foreach ($bookings as $booking) { - $booking->id; - $booking->created_at; - $booking->marking = $booking->user->marking; - $booking->rate; - $booking->amount; - $booking->bia; - $booking->admin_status = "(". $booking->admin_status ."/7)";; - } - return $bookings; - } + // foreach ($bookings as $booking) { + // $booking->id; + // $booking->created_at; + // $booking->marking = $booking->user->marking; + // $booking->rate; + // $booking->amount; + // $booking->bia; + // $booking->admin_status = "(". $booking->admin_status ."/7)";; + // } + // return $bookings; + // } } diff --git a/composer.lock b/composer.lock index 6d0e86e8..aa761c45 100644 --- a/composer.lock +++ b/composer.lock @@ -1311,7 +1311,7 @@ { "name": "Luís Otávio Cobucci Oblonczyk", "email": "lcobucci@gmail.com", - "role": "developer" + "role": "Developer" } ], "description": "A simple library to work with JSON Web Token and JSON Web Signature", @@ -1715,33 +1715,29 @@ }, { "name": "paragonie/random_compat", - "version": "v2.0.17", + "version": "v9.99.99", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", "shasum": "" }, "require": { - "php": ">=5.2.0" + "php": "^7" }, "require-dev": { - "phpunit/phpunit": "4.*|5.*" + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" }, "suggest": { "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." }, "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -1760,7 +1756,7 @@ "pseudorandom", "random" ], - "time": "2018-07-04T16:31:37+00:00" + "time": "2018-07-02T15:55:56+00:00" }, { "name": "psr/container", @@ -2030,21 +2026,22 @@ }, { "name": "ramsey/uuid", - "version": "3.7.3", + "version": "3.8.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76" + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/44abcdad877d9a46685a3a4d221e3b2c4b87cb76", - "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3", "shasum": "" }, "require": { - "paragonie/random_compat": "^1.0|^2.0", - "php": "^5.4 || ^7.0" + "paragonie/random_compat": "^1.0|^2.0|9.99.99", + "php": "^5.4 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "replace": { "rhumsaa/uuid": "self.version" @@ -2052,16 +2049,17 @@ "require-dev": { "codeception/aspect-mock": "^1.0 | ~2.0.0", "doctrine/annotations": "~1.2.0", - "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1", + "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ~2.1.0", "ircmaxell/random-lib": "^1.1", "jakub-onderka/php-parallel-lint": "^0.9.0", "mockery/mockery": "^0.9.9", "moontoast/math": "^1.1", "php-mock/php-mock-phpunit": "^0.3|^1.1", - "phpunit/phpunit": "^4.7|^5.0", + "phpunit/phpunit": "^4.7|^5.0|^6.5", "squizlabs/php_codesniffer": "^2.3" }, "suggest": { + "ext-ctype": "Provides support for PHP Ctype functions", "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", @@ -2106,7 +2104,7 @@ "identifier", "uuid" ], - "time": "2018-01-20T00:28:24+00:00" + "time": "2018-07-19T23:38:55+00:00" }, { "name": "swiftmailer/swiftmailer", diff --git a/resources/assets/js/pages/admin/home.vue b/resources/assets/js/pages/admin/home.vue index f1543d9f..09850a2c 100644 --- a/resources/assets/js/pages/admin/home.vue +++ b/resources/assets/js/pages/admin/home.vue @@ -63,7 +63,6 @@ export default { ], url: 'api/admin/booking', loading_btn: false, - } }, mounted () { @@ -73,7 +72,8 @@ export default { getBooking() { let $this = this axios.get(this.url).then(response => { - this.bookingTable = response.data + // this.bookingTable = response.data + console.log(response); }) }, RefreshBooking() { diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 15aa49f6..4bb9b48a 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a +class ComposerStaticInit0eb1f3eb0d8144627e65b3e93f0783e4 { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', @@ -15,7 +15,6 @@ class ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a '2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php', 'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php', 'f0906e6318348a765ffb6eb24e0d0938' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/helpers.php', '58571171fd5812e6e447dce228f52f4d' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/helpers.php', @@ -444,9 +443,11 @@ class ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a 'App\\Http\\Controllers\\RateController' => __DIR__ . '/../..' . '/app/Http/Controllers/RateController.php', 'App\\Http\\Controllers\\SettingActiveBankController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingActiveBankController.php', 'App\\Http\\Controllers\\SettingBeneficiaryController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingBeneficiaryController.php', + 'App\\Http\\Controllers\\SettingBillingChargeController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingBillingChargeController.php', 'App\\Http\\Controllers\\SettingCreditController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingCreditController.php', 'App\\Http\\Controllers\\SettingMalaysiaBankController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingMalaysiaBankController.php', 'App\\Http\\Controllers\\SettingSupplierController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingSupplierController.php', + 'App\\Http\\Controllers\\SettingTaxRateController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingTaxRateController.php', 'App\\Http\\Controllers\\Settings\\PasswordController' => __DIR__ . '/../..' . '/app/Http/Controllers/Settings/PasswordController.php', 'App\\Http\\Controllers\\Settings\\ProfileController' => __DIR__ . '/../..' . '/app/Http/Controllers/Settings/ProfileController.php', 'App\\Http\\Controllers\\UserController' => __DIR__ . '/../..' . '/app/Http/Controllers/UserController.php', @@ -474,9 +475,11 @@ class ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a 'App\\Role' => __DIR__ . '/../..' . '/app/Role.php', 'App\\SettingActiveBank' => __DIR__ . '/../..' . '/app/SettingActiveBank.php', 'App\\SettingBeneficiary' => __DIR__ . '/../..' . '/app/SettingBeneficiary.php', + 'App\\SettingBillingCharge' => __DIR__ . '/../..' . '/app/SettingBillingCharge.php', 'App\\SettingCredit' => __DIR__ . '/../..' . '/app/SettingCredit.php', 'App\\SettingMalaysiaBank' => __DIR__ . '/../..' . '/app/SettingMalaysiaBank.php', 'App\\SettingSupplier' => __DIR__ . '/../..' . '/app/SettingSupplier.php', + 'App\\SettingTaxRate' => __DIR__ . '/../..' . '/app/SettingTaxRate.php', 'App\\SupplierBooking' => __DIR__ . '/../..' . '/app/SupplierBooking.php', 'App\\SupplierBookingItem' => __DIR__ . '/../..' . '/app/SupplierBookingItem.php', 'App\\User' => __DIR__ . '/../..' . '/app/User.php', @@ -1822,6 +1825,7 @@ class ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a 'Illuminate\\Database\\Console\\Migrations\\ResetCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Console/Migrations/ResetCommand.php', 'Illuminate\\Database\\Console\\Migrations\\RollbackCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php', 'Illuminate\\Database\\Console\\Migrations\\StatusCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Console/Migrations/StatusCommand.php', + 'Illuminate\\Database\\Console\\Migrations\\TableGuesser' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Console/Migrations/TableGuesser.php', 'Illuminate\\Database\\Console\\Seeds\\SeedCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php', 'Illuminate\\Database\\Console\\Seeds\\SeederMakeCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php', 'Illuminate\\Database\\DatabaseManager' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/DatabaseManager.php', @@ -3902,8 +3906,10 @@ class ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a 'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php', 'SettingActiveBankSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingActiveBankSeeder.php', 'SettingBeneficiarySeeder' => __DIR__ . '/../..' . '/database/seeds/SettingBeneficiarySeeder.php', + 'SettingBillingChargeSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingBillingChargeSeeder.php', 'SettingCreditSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingCreditSeeder.php', 'SettingMalaysiaBankSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingMalaysiaBankSeeder.php', + 'SettingTaxRateSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingTaxRateSeeder.php', 'SuppliersTableSeeder' => __DIR__ . '/../..' . '/database/seeds/SuppliersTableSeeder.php', 'Symfony\\Component\\Console\\Application' => __DIR__ . '/..' . '/symfony/console/Application.php', 'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => __DIR__ . '/..' . '/symfony/console/CommandLoader/CommandLoaderInterface.php', @@ -4692,10 +4698,10 @@ class ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a::$prefixesPsr0; - $loader->classMap = ComposerStaticInitd25bd0e0a08d62ddf2d6158c09bb8e4a::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit0eb1f3eb0d8144627e65b3e93f0783e4::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit0eb1f3eb0d8144627e65b3e93f0783e4::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit0eb1f3eb0d8144627e65b3e93f0783e4::$prefixesPsr0; + $loader->classMap = ComposerStaticInit0eb1f3eb0d8144627e65b3e93f0783e4::$classMap; }, null, ClassLoader::class); }