<form id="updateReceivevAccountForm">
    <div class="row">
        <div class="col-md-4">
            <div class="form-group">
                <label for="received_date">تاریخ: <span class="text-danger">*</span></label>
                <input type="date" id="u_received_date" name="received_date" class="form-control change_focus"
                       data-id="adv_cash"
                       value="{{ date('Y-m-d', strtotime($receiving->received_date)) }}">
                <span class="text-danger r_error" id="u_received_date_error"></span>
            </div>
        </div>
        <div class="col-md-4">
            <label for="">ادائیگی قسم:</label><br>
            <label for="u_adv_cash">
                <input type="radio" name="payment_type"
                       onchange="receiving_payment_change('cash','yes')" @checked($receiving->payment_type=='cash')
                       class="change_focus" data-id="u_adv_bank_payment"
                       id="u_adv_cash" value="cash">
                کیش</label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <label for="u_adv_bank_payment">
                <input type="radio" name="payment_type" class="change_focus"
                       data-id="u_adv_broker_payment"
                       onchange="receiving_payment_change('bank','yes')" @checked($receiving->payment_type=='bank')
                       id="u_adv_bank_payment" value="bank">
                بینک</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <label for="u_adv_broker_payment">
                <input type="radio" name="payment_type" data-id="u_received_amount" class="change_focus"
                       onchange="receiving_payment_change('broker','yes')"
                       @checked($receiving->payment_type=='on_account')
                       id="u_adv_broker_payment" value="on_account">
                ان اکاوؑنٹ</label>
            <br>
            <span class="text-danger error" id="payment_type_error"></span>
        </div>
        <div class="col-md-4" id="u_adv_bank_dev">
            @if($receiving->payment_type=='bank')
                <label for="">بینک:</label><br>

                <select name="bank" id="u_adv_bank" class="from-control">
                    <option value="">----Select Bank----</option>
                    @forelse($banks as $bank)
                        <option
                            value="{{ $bank->id }}" @selected($receiving->bank_id == $bank->id)>{{ $bank->name }}</option>
                    @empty
                        <option value="">NO BANK AVAILABLE</option>
                    @endforelse
                </select>
                <span class="text-danger error" id="u_bank_error"></span>

            @endif
            @if($receiving->payment_type=='on_account')
                <label for="">اکاوؑنٹ:</label><br>

                <select name="party" onchange="receiving_amount_change('yes')"
                        id="u_adv_broker" class="from-control">
                    <option value="">----Select Account----</option>
                    @forelse($brokers as $broker)
                        <option value="{{ $broker->id }}"
                                @selected($receiving->party_name=="broker"&& $receiving->party_id== $broker->id) data-table="broker">{{ $broker->name }}</option>
                    @empty
                    @endforelse    @forelse($pumps as $pump)
                        <option value="{{ $pump->id }}"
                                @selected($receiving->party_name=="pump"&& $receiving->party_id== $pump->id)  data-table="pump">{{ $pump->name }}</option>
                    @empty
                    @endforelse
                </select><br>

                <span class="text-danger error" id="u_party_error"></span>

            @endif
        </div>
    </div>
    <div class="row mt-2">
        <div class="col-md-4">
            <div class="form-group">
                <label for="received_amount">رقم: <span class="text-danger">*</span></label>
                <input type="number" min="0" id="u_received_amount" name="received_amount"
                       value="{{ $receiving->amount }}"
                       class="form-control change_focus" data-id="u_received_date">
                <span class="text-danger r_error" id="u_received_amount_error"></span>
            </div>
        </div>
    </div>
    <div class="row mt-2">
        <div class="col-md-12">
            <div class="form-group">
                <label for="rec_note">ریمارکس:</label>
                <textarea rows="2" id="u_rec_note" name="rec_note" class="form-control"></textarea>
                <span class="text-danger r_error" id="u_rec_note_error"></span>

            </div>
        </div>
    </div>
    @csrf
    <input type="hidden" name="trip_id" value="{{ $trip->id }}">
    <input type="hidden" name="update_id" value="{{ $receiving->id }}">
    <input type="hidden" name="received_party_table" id="u_received_party_table" value="{{ $receiving->party_name }}">
    <button type="submit" class="btn btn-success btn-sm" name="receivedAcSubmit" id="receivedAcUpdate">
        اپڈیٹ
    </button>
    <button type="button" class="btn btn-sm btn-info" onclick="cancel_update_form({{ $trip->id }})">Cancel
    </button>
</form>
