{% set userData = app.session.get('userData') %}
<h5>{{ page_title }}</h5>
<form action="{{ path('material_requisition_purchase_invoice_other_cost_form', {id: id, action: action}) }}" method="POST">
    <div class="row">
        <div class="columns small-4 text-right">
            {{ form_label(form.description) }}
        </div>
        <div class="columns small-8">
            {{ form_widget(form.description) }}
        </div>
    </div>
    <div class="row">
        <div class="columns small-4 text-right">
            {{ form_label(form.amount) }}
        </div>
        <div class="columns small-8">
            {{ form_widget(form.amount) }}
        </div>
    </div>
    <hr>
    <div class="button-container">
        <button type="submit" class="button just-continue" name="action" value="{{ action }}"
                data-message="Are you sure you want to save this information?"
        >Save</button>
        {% if action == 'u' and (userData.type == 'Super Admin' or 'Admin Purchase Invoice Other Cost Delete' in userData.accesses) %}
            <button type="submit" class="ask-continue button alert" name="action" value="d"
                    data-message="Are you sure you want to delete this record?"
            >Delete</button>
        {% endif %}
        <button type="button" data-close class="button secondary">Close</button>
    </div>

    {{ form_widget(form.action) }}
    {{ form_widget(form.id) }}
    {{ form_widget(form._token) }}
    {{ form_widget(form.purchaseInvoice) }}
</form>