multiple po and invoice fix

This commit is contained in:
Omair Saleh
2019-05-03 10:29:59 +08:00
parent 140196288c
commit 7ca1f165de
2 changed files with 34 additions and 9 deletions
+10 -3
View File
@@ -246,7 +246,7 @@ class BookingController extends Controller
$user_bankslip = $booking->userBankSlip()->first();
$china_bankslip = $booking->chinaBankSlip()->get();
$po = $booking->purchaseOrder()->first();
$po = $booking->purchaseOrder()->get();
$invoice = $booking->invoice()->first();
if ($user_bankslip){
@@ -268,12 +268,19 @@ 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;
if($booking){
if ($booking->amount < 10000 && ($booking->term === 'x2_cash' || $booking->term === 'x2_cheque' || $booking->term === 'x2_ba')) {
@@ -12,13 +12,22 @@
<div class="card">
<div class="card-header">Purchase Order</div>
<div class="row">
<div class="card-body">
<a target="_blank" :href="getURL(booking_details.user_po_path)">
<img v-if="isImage(booking_details.user_po_path)" v-bind:src="booking_details.user_po_path" class="image">
<div v-for="user_po_path in booking_details.user_po_path" :key='cn_bankslip'>
<a target="_blank" :href="getURL(cn_bankslip)">
<img v-if="isImage(user_po_path)" v-bind:src="user_po_path" class="image">
<p v-else>Download</p>
<br/>
</a>
</div>
</div>
<!--<div class="row">-->
<!--<div class="card-body">-->
<!--<a target="_blank" :href="getURL(booking_details.user_po_path)">-->
<!--<img v-if="isImage(booking_details.user_po_path)" v-bind:src="booking_details.user_po_path" class="image">-->
<!--<p v-else>Download</p>-->
<!--</a>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
<div class="col">
@@ -39,13 +48,22 @@
<div class="card">
<div class="card-header">Invoice</div>
<div class="row">
<div class="card-body">
<a target="_blank" :href="getURL(booking_details.invoice_path)">
<img v-if="isImage(booking_details.invoice_path)" v-bind:src="booking_details.invoice_path" class="image">
<div v-for="invoice_path in booking_details.invoice_path" :key='cn_bankslip'>
<a target="_blank" :href="getURL(cn_bankslip)">
<img v-if="isImage(invoice_path)" v-bind:src="invoice_path" class="image">
<p v-else>Download</p>
<br/>
</a>
</div>
</div>
<!--<div class="row">-->
<!--<div class="card-body"> -->
<!--<a target="_blank" :href="getURL(booking_details.invoice_path)">-->
<!--<img v-if="isImage(booking_details.invoice_path)" v-bind:src="booking_details.invoice_path" class="image">-->
<!--<p v-else>Download</p>-->
<!--</a>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
</div>