{% extends 'base.html' %}
{% block body %}
<!-- <form method="POST" action="{{ request.path }}"> -->
    <div class="container">
    <form method="POST" action="{% url 'Invoice:choose_inv' %}" class="modal-content">
    {% csrf_token %}
        <div class="modal-header">
            <h2>Select SO Customer: {{ customer_fullname }}</h2>
        </div>
        <div class="modal-body">
            <div class="mb-3 mt-3">
                <input type="hidden" name="customer_fullname" value="{{ customer_fullname }}">
                <!-- <input name="customerreffullname" type='text' list='itemname'  value='{{customer_name}}' id='id_CustomerRefFullName' class='textinput form-control' autofocus> -->
                <table class="table table-striped">
                    <thead>
                        <tr>
                          <th scope="col">Date</th>
                          <th scope="col">Amount</th>
                          <th scope="col">SO Number</th>
                          <!-- <th scope="col">Handle</th> -->
                        </tr>
                    </thead>
                    <tbody>
                        {% for so_no in objects %}
                        <tr>
                            <td>
                            <div class="form-check">
                                <input type="checkbox" name="so_field" value="{{ so_no.0 }}" id="id_so_field_{{forloop.counter}}" class="form-check-input">
                                <label for="id_so_field_{{ forloop.counter }}" class="form-check-label">{{ so_no.1 }}
                                </label>
                            </div>
                            </td>
                            <td>{{ so_no.2 }}</td>
                            <td>{{ so_no.3 }}</td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
                
            </div>
        </div>
        <div class="modal-footer">
            <button type="submit" class="btn btn-primary mt-2 me-2 ms-2" id="id_btnsave" >Choose</button>
        </div>
    </form>
</div>
{% endblock %}