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')) {