{% extends '@RxConnexion/Admin/global.html.twig' %}
{% block body %}
    <h5 class="report-header">{{ page_title }}</h5>
    <table class="report-data" width="100%">
        <thead class="header">
        <tr>
            <th>Invoice</th>
            <th>Refund Date</th>
            <th>Patient</th>
            <th>Billing Branch</th>
            <th>Billing Address</th>
            <th>Amount Due</th>
            <th>Amount Paid</th>
            <th>Amount Balance</th>
            <th>Amount Refunded</th>
            <th>Note</th>
        </tr>
        </thead>
        <tbody>
        {% set totalCount = 0 %}
        {% for record in records %}
            {% set trC = loop.index > 1 and loop.index % 2 == 0 ? 'even' : 'odd' %}
            {% set totalCount = totalCount + 1 %}
            <tr class="{{ trC }}">
                <td>{{ record.invoiceNo }}</td>
                <td>{{ record.refundDate }}</td>
                <td><a href="{{ path('patient_detail', {patient_id : record.patientId|base64Encode, tab:'b', tab2:'bref'}) }}" target="_blank">{{ record.patientName }}</a></td>
                <td>{{ record.healthFacility }}</td>
                <td>{{ record.healthFacilityAddress }}</td>
                <td>{{ record.amountDue }}</td>
                <td>{{ record.amountPaid }}</td>
                <td>{{ record.amountBalance }}</td>
                <td>{{ record.amountRefund }}</td>
                <td>{{ record.note }}</td>
            </tr>
        {% endfor %}
    </table>
    <div>Total Records: {{ totalCount }}</div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[
        jQ(document).ready(function(){
            report_preview.init();
        });
        //]]>
    </script>
{% endblock %}