diff --git a/app/Booking.php b/app/Booking.php
index a6be11c4..6daa1d89 100644
--- a/app/Booking.php
+++ b/app/Booking.php
@@ -43,5 +43,9 @@ class Booking extends Model
public function userBankSlip(){
return $this->hasOne(UserBankSlip::class);
}
+
+ public function purchaseOrder(){
+ return $this->hasOne(PurchaseOrder::class);
+ }
}
diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php
index 2a0daed0..0aa06493 100644
--- a/app/Http/Controllers/BookingController.php
+++ b/app/Http/Controllers/BookingController.php
@@ -422,11 +422,18 @@ class BookingController extends Controller
public function confirmPurchaseOrder($id){
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
- $booking->status = 5;
+ $booking->status = 6;
$booking->save();
return response()->json(['message'=>'Success'],200);
}
+ public function showPurchaseOrder($id){
+ $booking = Booking::where('id',$id)->first();
+ $user_po = $booking->purchaseOrder()->first();
+
+ return response()->json(['po_path'=> $user_po],200);
+ }
+
public function delete(Booking $book_id)
{
$booking = Booking::where('user_id', Auth::user())->where('id', $book_id)->firstOrFail();
diff --git a/app/PurchaseOrder.php b/app/PurchaseOrder.php
index 72345a6f..71227d02 100644
--- a/app/PurchaseOrder.php
+++ b/app/PurchaseOrder.php
@@ -7,4 +7,9 @@ use Illuminate\Database\Eloquent\Model;
class PurchaseOrder extends Model
{
protected $fillable = ['image_url','amount','booking_id'];
+
+ public function booking()
+ {
+ return $this->belongsTo(Booking::class);
+ }
}
diff --git a/database/migrations/2018_06_28_011717_rename_booking_foreignkey_in_po_table.php b/database/migrations/2018_06_28_011717_rename_booking_foreignkey_in_po_table.php
new file mode 100644
index 00000000..27f8b18a
--- /dev/null
+++ b/database/migrations/2018_06_28_011717_rename_booking_foreignkey_in_po_table.php
@@ -0,0 +1,33 @@
+dropForeign('book_id');
+ $table->integer('booking_id')->unsigned();
+ $table->foreign('booking_id')->references('id')->on('bookings');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ //
+ }
+}
diff --git a/resources/assets/js/components/AdminProgressTrack.vue b/resources/assets/js/components/AdminProgressTrack.vue
index dfae9647..3cff63df 100644
--- a/resources/assets/js/components/AdminProgressTrack.vue
+++ b/resources/assets/js/components/AdminProgressTrack.vue
@@ -6,6 +6,7 @@
+
diff --git a/resources/assets/js/components/ProgressTrack.vue b/resources/assets/js/components/ProgressTrack.vue
index 00c85c5d..0161e8b0 100644
--- a/resources/assets/js/components/ProgressTrack.vue
+++ b/resources/assets/js/components/ProgressTrack.vue
@@ -6,6 +6,7 @@
+
diff --git a/resources/assets/js/pages/admin/booking/completed.vue b/resources/assets/js/pages/admin/booking/completed.vue
new file mode 100644
index 00000000..42585d3c
--- /dev/null
+++ b/resources/assets/js/pages/admin/booking/completed.vue
@@ -0,0 +1,165 @@
+
+
+
+
+
+
Order Completed
+
+
+
+
+
+
+
+
+
+ Purchase Order
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Invoice
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ China Bank Slip
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Order Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Order Bankin Slip
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/assets/js/pages/admin/booking/uploadInvoice.vue b/resources/assets/js/pages/admin/booking/uploadInvoice.vue
index 37196cb3..1c05fbc3 100644
--- a/resources/assets/js/pages/admin/booking/uploadInvoice.vue
+++ b/resources/assets/js/pages/admin/booking/uploadInvoice.vue
@@ -1,13 +1,20 @@
-
+
-
Transfer In Progress
+
-
ETA : 3 days 14 Hours
+
+
Upload Invoice
+
+
+
Waiting for User to Upload Purchase Order
+
+ Go Back
+
-
Go Back
+
@@ -16,7 +23,165 @@
Order Details
-
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ Order Number :
+ |
+
+ {{ booking_details.id }}
+ |
+
+
+ |
+ Date :
+ |
+
+ {{ booking_details.created_at }}
+ |
+
+
+ |
+ Customer Marking :
+ |
+
+ CIEF/150ECE
+ |
+
+
+ |
+
+ |
+
+
+ |
+
+
+ |
+ Term :
+ |
+
+ {{ booking_details.term }}
+ |
+
+
+ |
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ CNY/RMB :
+ |
+
+ CNY {{ booking_details.amount }}
+ |
+
+
+ |
+ + Service Charge :
+ |
+
+ CNY {{ booking_details.service_charge }}
+ |
+
+
+ |
+ / RATE :
+ |
+
+ {{ booking_details.rate }}
+ |
+
+
+ |
+
+ |
+
+ MYR {{ booking_details.bia }}
+ |
+
+
+
+ |
+
+ |
+
+
+ MYR {{ booking_details.bia }}
+
+ |
+
+
+ |
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- BankinSlip
-
-
-
-
-
-
-
-
+
+
+
+
+ Upload Invoice
+
+
+
+
+
+
+ Drop file here or
+ click to upload
+
+ jpg/png/pdf files with a size less than 3mb
+
+
+
+
+
+ Submit
+
+
+
+
+
+
+
+
+ Customer Purchase Order
+
+
+
+
+
+
+
+
+
+
+
@@ -55,20 +253,162 @@
}
+
\ No newline at end of file
diff --git a/resources/assets/js/pages/booking/po.vue b/resources/assets/js/pages/booking/po.vue
new file mode 100644
index 00000000..fe69da23
--- /dev/null
+++ b/resources/assets/js/pages/booking/po.vue
@@ -0,0 +1,115 @@
+
+
+
+
+
+
Processing Invoice
+
+
+ Go Back
+
+
+
+
+
+ Order Details
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BankinSlip
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/assets/js/pages/home.vue b/resources/assets/js/pages/home.vue
index 26528fe4..a0b23006 100644
--- a/resources/assets/js/pages/home.vue
+++ b/resources/assets/js/pages/home.vue
@@ -57,7 +57,7 @@
X1 :
- 1.56
+ 1.70
1.64
diff --git a/resources/assets/js/pages/settings/index.vue b/resources/assets/js/pages/settings/index.vue
index dcdac990..9dfd7811 100644
--- a/resources/assets/js/pages/settings/index.vue
+++ b/resources/assets/js/pages/settings/index.vue
@@ -4,9 +4,8 @@
-
-
-
- {{ tab.name }}
+
+ {{ tab.name }}
@@ -22,50 +21,63 @@
+ .settings-card .card-body {
+ padding: 0;
+ }
+
\ No newline at end of file
diff --git a/resources/assets/js/router/routes.js b/resources/assets/js/router/routes.js
index f5eb718d..6d291031 100644
--- a/resources/assets/js/router/routes.js
+++ b/resources/assets/js/router/routes.js
@@ -21,6 +21,7 @@ const Transfer = () => import('~/pages/booking/transfer').then(m => m.default ||
const UploadPo = () => import('~/pages/booking/uploadPo').then(m => m.default || m)
const PoComplete = () => import('~/pages/booking/poComplete').then(m => m.default || m)
const Completed = () => import('~/pages/booking/completed').then(m => m.default || m)
+const PurchaseOrder = () => import('~/pages/booking/po').then(m => m.default || m)
// Admin booking
const Verification = () => import('~/pages/admin/booking/verification').then(m => m.default || m)
@@ -28,6 +29,7 @@ const Supplier = () => import('~/pages/admin/booking/supplierBooking').then(m =>
const SupplierReport = () => import('~/pages/admin/booking/supplierReport').then(m => m.default || m)
const UploadCNSlip = () => import('~/pages/admin/booking/uploadChinaBankslip').then(m => m.default || m)
const UploadInvoice = () => import('~/pages/admin/booking/uploadInvoice').then(m => m.default || m)
+const adminCompleted = () => import('~/pages/admin/booking/completed').then(m => m.default || m)
// const Completed = () => import('~/pages/booking/uploadUserBankSlip').then(m => m.default || m)
// Admin pages
@@ -62,6 +64,7 @@ export default [
{ path: '/booking/:id/transfer', name: 'booking.user.transfer', component: Transfer },
{ path: '/booking/:id/upload-po', name: 'booking.user.uploadpo', component: UploadPo },
{ path: '/booking/:id/po-complete', name: 'booking.user.pocomplete', component: PoComplete },
+ { path: '/booking/:id/po', name: 'booking.complete', component: PurchaseOrder },
{ path: '/booking/:id/complete', name: 'booking.complete', component: Completed },
// Admin booking
@@ -70,7 +73,7 @@ export default [
{ path: '/booking/:id/supplier-report', name: 'booking.admin.supplier.report', component: SupplierReport },
{ path: '/booking/:id/upload-cn-bankslip', name: 'booking.admin.cnslip', component: UploadCNSlip },
{ path: '/booking/:id/upload-invoice', name: 'booking.admin.invoice', component: UploadInvoice },
- // { path: '/booking/:id/complete', name: 'booking.complete', component: Completed },
+ { path: '/booking/:id/admin/complete', name: 'booking.admin.complete', component: adminCompleted },
// Admin pages
{ path: '/admin', name: 'admin.home', component: AdminHome },
diff --git a/routes/api.php b/routes/api.php
index 1b2ca525..fe413583 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -103,6 +103,9 @@ Route::group(['middleware' => ['role:admin']], function() {
Route::post('/booking/{id}/upload-china-bankslip','ChinaBankSlipController@store');
Route::patch('/booking/{id}/update-china-bankslip','ChinaBankSlipController@update');
+
+ Route::get('/booking/{id}/po', 'BookingController@showPurchaseOrder');
+
});