mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 20:44:13 +00:00
fix edit supplier booking
fix done supplier booking report button loading
This commit is contained in:
@@ -48,11 +48,6 @@ class BookingSupplierController extends Controller
|
||||
$booking_id = $request->input("booking_id");
|
||||
$rate = $request->input('rate');
|
||||
$rebate = $request->input('rebate');
|
||||
|
||||
if ($supplierbooking = SupplierBooking::where('book_id', $booking_id)->first()){
|
||||
return response()->json(['success'=>false, 'message'=>'Bad request, please contact support'], 400);
|
||||
}
|
||||
|
||||
|
||||
// Calculation
|
||||
$amountInRMB = $transfer_amount * $rate;
|
||||
@@ -66,7 +61,14 @@ class BookingSupplierController extends Controller
|
||||
$supplier = SettingSupplier::find($supplier_id);
|
||||
$booking = Booking::find($booking_id);
|
||||
|
||||
$bookingsupplier = new SupplierBooking();
|
||||
// update existing booking supplier if exist
|
||||
$bookingsupplier = SupplierBooking::where('book_id', $booking_id)->first();
|
||||
|
||||
if (!$bookingsupplier){
|
||||
$bookingsupplier = new SupplierBooking();
|
||||
|
||||
}
|
||||
|
||||
$bookingsupplier->supplier_id = $supplier->id;
|
||||
$bookingsupplier->payment_method = $request->input('payment_method');
|
||||
$bookingsupplier->transfer_amount = $transfer_amount;
|
||||
@@ -90,7 +92,7 @@ class BookingSupplierController extends Controller
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$bookingsupplier = BSupplierBooking::find($id);
|
||||
$bookingsupplier = SupplierBooking::find($id);
|
||||
$bookingsupplier->payment_method = $request->input('payment_method');
|
||||
$bookingsupplier->transfer_amount = $request->input('transfer_amount');
|
||||
$bookingsupplier->rate = $request->input('rate');
|
||||
|
||||
Reference in New Issue
Block a user