{% set userData = app.session.get('userData') %}
<form id="form-transmittalItemDelivery" method="POST">
    <input type="hidden" name="transmittal_id" value="{{ transmittal_id }}" />
    <h4>{{ page_title }}</h4>
    <div id="flash-messages-content-modal"></div>
    <p class="form-hint-text">Enter basic information below</p>
    <div class="row">
        <div class="large-4 large-text-right columns">
            <label class="middle">Receive Date</label>
        </div>
        <div class="large-8 columns">
            <input type="text" name="transmittalItemDelivery[receiveDate]" class="date" value="{{ 'now'|date('m/d/Y') }}" placeholder="MM/DD/YYYY" />
        </div>
    </div>
    <table class="display responsive" id="transmittalItemList-datalist" width="100%">
        <thead>
        <tr>
            <th>Item</th>
            <th>Location</th>
            <th>Required Quantity</th>
            <th>Received Quantity</th>
            <th>Quantity</th>
        </tr>
        </thead>
        <tbody>
        {% for key,transmittalItem in transmittal.transmittalitems %}
            <tr>
                <td>{{ transmittalItem.materialrequisitionitem.item.description }}</td>
                <td>
                    <select name="transmittalItems[{{ key }}][location_id]" style="height: auto;">
                        {% for location in transmittal.branchto.locations %}
                        <option value="{{ location.id }}">{{ location.description }}</option>
                        {% endfor %}
                    </select>
                </td>
                <td>{{ transmittalItem.quantity }}</td>
                <td>{{ transmittalItem.quantityreceived }}</td>
                <td>
                    <input type="hidden" name="transmittalItems[{{ key }}][id]" value="{{ transmittalItem.id }}" />
                    <input type="text" class="quantity" name="transmittalItems[{{ key }}][quantity]" value="" />
                </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-transmittalItemDelivery-actionAll float-right" id="href-transmittalItemDelivery-actionAll" name="action" value=""
                        data-message="Are you sure you want to save this information?"
                >Save</button>
            </div>
        </div>
    </div>
</form>