{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <form method="POST" action="{{ path('accounting_billing_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">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.type) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.type) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.patientBillingInvoiceNumber) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.patientBillingInvoiceNumber) }}
                        {{ form_widget(form.patientBilling) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.patientPaymentNumber) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.patientPaymentNumber) }}
                        {{ form_widget(form.patientPayment) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.patientBillingRefundNumber) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.patientBillingRefundNumber) }}
                        {{ form_widget(form.patientBillingRefund) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.status) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.status) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.amount) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.amount) }}
                    </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 Accounting Billing 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_billing') }}" class="button secondary">Back</a>
                </div>
            </div>
        </div>
        {{ form_widget(form.action) }}
        {{ form_widget(form.id) }}
        {{ form_widget(form._token) }}
    </form>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[
        jQ(document).ready(function(){
            accounting_billing_form.settings.patientBilling_autocomplete = '{{ path('patient_billing_autocomplete') }}'
            accounting_billing_form.settings.patientPayment_autocomplete = '{{ path('patient_payment_autocomplete') }}'
            accounting_billing_form.settings.patientRefund_autocomplete = '{{ path('patient_refund_autocomplete') }}'
            accounting_billing_form.init();
        });
        //]]>
    </script>
{% endblock %}