<form class="row g-3 auto-width"action="{!! route('bookingdetails-view-update', $booking->id) !!}"  method="post" enctype='multipart/form-data'>
    @csrf
    {{-- @method('patch') --}}
   <div class="col-md-6  mb-1">
            <label for="voucher_type">Voucher Type<span class="text-danger"><b>*</b></span></label>
             <select name="voucher_type" id="voucher_type" class="form-control ">
                <option value="">~Select~</option>
                @foreach($voucher_types as $voucher)
                <option value="{{ $voucher->voucher_id }}" {{ $booking->voucher_type_id == $voucher->voucher_id ? 'selected' : '' }}>{{ $voucher->code }}</option>
                @endforeach                                   
            </select>
            <span class="text-danger error_voucher_type" style="display: none;">This field is required.</span>
        </div>
        <div class="col-md-6  mb-1">
            <label for="transportation_id" class="control-label">Transportation Mode<span class="text-danger"><b>*</b></span></label>
            <select name="transportation_id" id="transportation_id" class="form-control ">
                @foreach($transportations as $transportation)
                <option value="{{ $transportation->id}}"{{ $booking->transportation_mode_id == $transportation->id ? 'selected' : '' }}>{{ $transportation->code }}</option>
                @endforeach
            </select>
            <span class="text-danger error_transportation_id" style="display: none;">This field is required.</span>
        </div>
         <div class="col-md-6  mb-1">
            <label for="bill_to_party" class="control-label">Bill to Party<span class="text-danger"><b>*</b></span></label>
            <select name="bill_to_party" id="bill_to_party" class="form-control ">
                <option value="{{ $bill_to_party['consignor']['id'] }}" {{ isset($bill_to_party['consignor']) ? 'selected' : '' }}>
                    {{ $bill_to_party['consignor']['name']  }} (Consignor)
                </option>
                <option value="{{ $bill_to_party['consignee']['id'] }}" {{ isset($bill_to_party['consignee']) ? 'selected' : '' }}>
                    {{ $bill_to_party['consignee']['name'] }} (Consignee)
                </option>
                <option value=" {{ $bill_to_party['vendor']['id'] }}" {{ isset($bill_to_party['vendor']) ? 'selected' : '' }}>
                    {{ $bill_to_party['vendor']['name']  }} (Vendor)
                </option>
            </select>
            <span class="text-danger error_transportation_id" style="display: none;">This field is required.</span>
        </div>
        <div class="col-md-6  mb-1">
            <label for="">Tax Paid By<span class="text-danger"><b>*</b></span></label>
            <select name="taxpaidby" id="taxpaidby" class="taxpaidby  form-control">
                <option value="">~Select~</option>
                @foreach($taxpaidby as $taxpaidby)
                <option value="{{ $taxpaidby->id }}" {{ $booking->tax_paid_by_id == $taxpaidby->id ? 'selected' : '' }}>{{ $taxpaidby->code }}</option>
                @endforeach
            </select>
            <span class="text-danger error_taxpaidby" style="display: none;">This field is required.</span>
        </div>
        <div class=" col-md-6 mb-1">
            <label for="delivery_type" class="control-label ">Delivery Type<span class="text-danger"><b>*</b></span></label>
            <select class="form-control" id ="delivery_type" name="delivery_type">
            <option value="">~Select~</option>
               @foreach($deliveries as $delivery)
               <option value="{{$delivery->id}}" {{ $booking->delivery_type_id == $delivery->id ? 'selected' : '' }}>{{$delivery->name}}</option>
               @endforeach
           </select>
           <span class="text-danger error_delivery_type" style="display: none;">This field is required.</span>
        </div>
        <div class="col-md-6 mb-1">
            <label for="shipping_risk" class="control-label ">Shipping Risk<span class="text-danger"><b>*</b></span></label>
            <select class="form-control" id ="shipping_risk" name="shipping_risk">
               @foreach($risks as $risk)
               <option value="{{$risk->id}}" {{ $booking->shipping_risk == $risk->id ? 'selected' : '' }}>{{$risk->name}}</option>
               @endforeach
           </select>
           <span class="text-danger error_shipping_risk" style="display: none;">This field is required.</span>
        </div>
        <div class="col-md-6 mb-1">
            <label for="transport_type" class="control-label ">Transport Type<span class="text-danger"><b>*</b></span></label>
            <select class="form-control" id ="transport_type" name="transport_type">
                <option value="">~Select~</option>
               @foreach($transports as $transport)
               <option value="{{$transport->id}}" {{ $booking->transport_type_id == $transport->id ? 'selected' : '' }}>{{$transport->name}}</option>
               @endforeach
           </select>
           <span class="text-danger error_transport" style="display: none;">This field is required.</span>
        </div>
</form>