mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 12:24:09 +00:00
added relationship for invoice and booking
added confirm invoice feature (after user upload the image)
This commit is contained in:
@@ -423,19 +423,6 @@ class BookingController extends Controller
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function confirmPurchaseOrder($id){
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
|
||||
$purchase_order = $booking->purchaseOrder()->first();
|
||||
|
||||
if(!$purchase_order){
|
||||
return response()->json(["message"=> "Please upload your purchase order"],400);
|
||||
}
|
||||
|
||||
$booking->status = 6;
|
||||
$booking->save();
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function showPurchaseOrder($id){
|
||||
$booking = Booking::where('id',$id)->first();
|
||||
@@ -657,8 +644,38 @@ class BookingController extends Controller
|
||||
if($booking->save()){
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
}
|
||||
}
|
||||
|
||||
public function confirmPurchaseOrder($id){
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
|
||||
$purchase_order = $booking->purchaseOrder()->first();
|
||||
|
||||
if(!$purchase_order){
|
||||
return response()->json(["message"=> "Please upload your purchase order"],400);
|
||||
}
|
||||
|
||||
$booking->status = 6;
|
||||
$booking->save();
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function confirmInvoice(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('id', $id)->firstOrFail();
|
||||
|
||||
$invoice = $booking->invoice()->first;
|
||||
|
||||
if(!$invoice){
|
||||
return response()->json(["message"=> "Please upload your invoice"],400);
|
||||
}
|
||||
|
||||
$booking->status = 7; // processing transfer
|
||||
$booking->admin_status = 6; // upload china bankslip
|
||||
|
||||
|
||||
if($booking->save()){
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user