multiple po and invoice fix

This commit is contained in:
Omair Saleh
2019-05-03 11:11:02 +08:00
parent d0f9f669d7
commit 0f32805610
3 changed files with 24 additions and 28 deletions
+10 -4
View File
@@ -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;