fixed retrive po path in booking controller

updated chinabankslip error message to be more clear
fixed supplier booking report loading button
updated upload invoice frontend to show user po image
This commit is contained in:
Jack Goh
2018-06-28 15:07:41 +08:00
parent 0cf92b9936
commit 105b61eab3
6 changed files with 18 additions and 11 deletions
+6 -2
View File
@@ -441,7 +441,11 @@ class BookingController extends Controller
$booking = Booking::where('id',$id)->first();
$user_po = $booking->purchaseOrder()->first();
return response()->json(['po_path'=> $user_po],200);
if($user_po){
return response()->json(['user_po_path'=> $user_po->image_path ],200);
}
return response()->json(['message'=> 'waiting customer to upload their po'],400);
}
public function delete(Booking $book_id)
@@ -593,7 +597,7 @@ class BookingController extends Controller
//upload
public function uploadInvoice(Request $request, $id)
{
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
$booking = Booking::where('id',$id)->first();
/* Validation */
if (!$booking)