From 0f328056100acf2dc2da937bb0b5f5ad07f86c3a Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 3 May 2019 11:11:02 +0800 Subject: [PATCH] multiple po and invoice fix --- app/Http/Controllers/BookingController.php | 14 ++++++++---- .../js/pages/admin/booking/completed.vue | 22 ++++++++++++------- .../assets/js/pages/booking/completed.vue | 16 -------------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index d0ce0be5..375d7c81 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -320,8 +320,8 @@ class BookingController extends Controller $china_bankslip = null; } - $po = $booking->purchaseOrder()->first(); - $invoice = $booking->invoice()->first(); + $po = $booking->purchaseOrder()->get(); + $invoice = $booking->invoice()->get(); if($booking){ if ($user_bankslip){ @@ -338,11 +338,17 @@ class BookingController extends Controller } if($po){ - $booking->user_po_path = Storage::url($po->image_path); + for($index = 0;$index < count($po); $index++){ + $po[$index] = Storage::url($po[$index]->image_path); + } + $booking->user_po_path = $po; } if($invoice){ - $booking->invoice_path = Storage::url($invoice->invoice_path); + for($index = 0;$index < count($invoice); $index++){ + $invoice[$index] = Storage::url($invoice[$index]->invoice_path); + } + $booking->invoice_path = $invoice; } $booking->service_charge = 0; diff --git a/resources/assets/js/pages/admin/booking/completed.vue b/resources/assets/js/pages/admin/booking/completed.vue index bd18687e..f39495c7 100644 --- a/resources/assets/js/pages/admin/booking/completed.vue +++ b/resources/assets/js/pages/admin/booking/completed.vue @@ -21,10 +21,13 @@ - - -

Download

-
+
+ + +

Download

+
+
+
@@ -57,10 +60,13 @@ - - -

Download

-
+
+ + +

Download

+
+
+
diff --git a/resources/assets/js/pages/booking/completed.vue b/resources/assets/js/pages/booking/completed.vue index f4fefd91..6959b4f1 100644 --- a/resources/assets/js/pages/booking/completed.vue +++ b/resources/assets/js/pages/booking/completed.vue @@ -20,14 +20,6 @@ - - - - - - - -
@@ -56,14 +48,6 @@
- - - - - - - -