{% set userData = app.session.get('userData') %}
<form id="form-purchaseOrderBreakdownVoid" method="POST">
    <input type="hidden" name="purchaseOrderBreakdown_id" value="{{ purchaseOrderBreakdown_id }}" />
    <h4>{{ page_title }}</h4>
    <div id="flash-messages-content-modal"></div>
    <p class="form-hint-text">Enter basic information below</p>
    <table class="display responsive" id="purchaseOrderBreakdownItemVoid-datalist" width="100%">
        <thead>
        <tr>
            <th>Item</th>
            <th>Required Qty</th>
            <th>Qty Received</th>
            <th>Voidable Qty</th>
            <th>Voided Qty</th>
            <th>Notes</th>
        </tr>
        </thead>
        <tbody>
        {% for key,purchaseOrderBreakdownItem in purchaseOrderBreakdown.purchaseorderbreakdownitems %}
            <tr>
                <td>{{ purchaseOrderBreakdownItem.purchaseorderitem.materialrequisitionitem.item.description }}</td>
                <td>{{ purchaseOrderBreakdownItem.quantity }}</td>
                <td>{{ purchaseOrderBreakdownItem.quantityreceived }}</td>
                <td>{{ purchaseOrderBreakdownItem.quantityforvoiding }}</td>
                <td>
                    <input type="hidden" name="purchaseOrderBreakdownItems[{{ key }}][id]" value="{{ purchaseOrderBreakdownItem.id }}" />
                    <input type="text" class="amount" name="purchaseOrderBreakdownItems[{{ key }}][quantityVoided]" value="{{ purchaseOrderBreakdownItem.quantityvoided }}" />
                </td>
                <td>
                    <input type="text" class="" style="width: 100%" name="purchaseOrderBreakdownItems[{{ key }}][voidNotes]" required value="{{ purchaseOrderBreakdownItem.voidNotes }}" />
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    <br>
    <div class="row max-width-initial">
        <div class="small-12 columns no-padding-right">
            <div class="button-container clearfix">
                <button type="button" class="button just-continue href-purchaseOrderBreakdownVoid-action float-right alert" id="href-purchaseOrderBreakdownVoid-action" name="action" value=""
                        data-message="Are you sure you want to save this information?"
                >Void</button>
            </div>
        </div>
    </div>
</form>