{% set userData = app.session.get('userData') %}
<form id="form-purchaseOrderVoid" method="POST">
    <input type="hidden" name="purchaseOrder_id" value="{{ purchaseOrder_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="purchaseOrderItemVoid-datalist" width="100%">
        <thead>
        <tr>
            <th>Item</th>
            <th>Required Qty</th>
            <th>Qty With PO</th>
            <th>Voidable Qty</th>
            <th>Voided Qty</th>
        </tr>
        </thead>
        <tbody>
        {% for key,purchaseOrderItem in purchaseOrder.purchaseorderitems %}
            <tr>
                <td>{{ purchaseOrderItem.materialrequisitionitem.item.description }}</td>
                <td>{{ purchaseOrderItem.quantity }}</td>
                <td>{{ purchaseOrderItem.quantitywithpo }}</td>
                <td>{{ purchaseOrderItem.quantityforvoiding }}</td>
                <td>
                    <input type="hidden" name="purchaseOrderItems[{{ key }}][id]" value="{{ purchaseOrderItem.id }}" />
                    <input type="text" class="amount" name="purchaseOrderItems[{{ key }}][quantityVoided]" value="{{ purchaseOrderItem.quantityvoided }}" />
                </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-purchaseOrderVoid-action float-right" id="href-purchaseOrderVoid-action" name="action" value=""
                        data-message="Are you sure you want to save this information?"
                >Save</button>
            </div>
        </div>
    </div>
</form>