{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <form method="POST" action="{{ path('accounting_encoding_form', {action: action, id: id}) }}">
        <div class="row max-width-initial">
            <div class="large-6 columns">
                <h5>Basic information</h5>
                <p class="form-hint-text">Enter basic information below</p>
                <div class="row" style="margin-bottom: 10px;">
                    <div class="large-3 large-text-right columns">
                        <span>Accounting ID:</span>
                    </div>
                    <div class="large-9 columns">
                        <a href="{{ path('accounting_file_form', { action: 'u', id: accounting_encoding.accountingFile.id|base64Encode }) }}">{{ accounting_encoding.accountingFile.id|default('') }}</a>
                    </div>
                </div>
                <div class="row" style="margin-bottom: 10px;">
                    <div class="large-3 large-text-right columns">
                        <span>File: </span>
                    </div>
                    <div class="large-9 columns">
                        <a href="{{ path('accounting_file_download',{ id:accounting_encoding.id|base64Encode }) }}" style="color: black;">
                            <div style="width: 100%; border: 1px solid; padding: 2px; float: left;">
                                <i class="fa fa-file fa-5x"></i>
                                <div style="width: 80%; float: right;">{{ accounting_encoding.fileDesc|default('') }}</div>
                            </div>
                        </a>
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.encodeDate) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.encodeDate) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.checkDate) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.checkDate) }}
                    </div>
                </div>
            </div>
            <div class="large-6 columns">
            </div>
            <div class="small-12 columns">
                <hr class="max-width-initial">
                <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 Province 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 %}
                    <a href="{{ path('accounting_encoding') }}" class="button secondary">Back</a>
                </div>
            </div>
        </div>
        {{ form_widget(form.action) }}
        {{ form_widget(form.id) }}
        {#{{ form_widget(form.accountingFile) }}#}
        {{ form_widget(form._token) }}
    </form>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[
        {#accountUserType_form.settings.account_autocomplete_url = '{{ path('account_autocomplete') }}';#}
        {#jQ(document).ready(function(){#}
            {#accountUserType_form.init();#}
        {#});#}
        //]]>
    </script>
{% endblock %}