{% extends '@RxConnexion/Admin/global.html.twig' %}
{% block body %}
    {#<style>#}
        {#/*table { table-layout: fixed; }*/#}
        {#/*table th, table td { overflow: hidden; }*/#}
        {#table td { border : 1px solid #BAB8B6 !important; }#}
    {#</style>#}
    <h5 class="report-header">{{ page_title }}</h5>
    <table class="report-data" width="100%">
        <thead class="header">
        <tr>
            <th>Patient</th>
            <th>Company</th>
            <th>Branch</th>
            <th>Item</th>
            <th>Item Type</th>
            <th>Quantity</th>
            <th>Price</th>
            <th>Payment Day</th>
            <th>Amortization Amount</th>
            <th>Start Date</th>
            <th>End Date</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>
                <td><a href="{{ path('patient_detail', {patient_id : record.patientId|base64Encode, tab: 'pb'}) }}" target="_blank">{{ record.patientName }}</a></td>
                <td>{{ record.companyDesc }}</td>
                <td>{{ record.branchDesc }}</td>
                <td>{{ record.itemDesc }}</td>
                <td>{{ record.paymentPlanType }}</td>
                <td>{{ record.qty }}</td>
                <td>{{ record.price }}</td>
                <td style="text-align: right">{{ record.paymentDay }}</td>
                <td style="text-align: right">{{ record.amortizationAmt }}</td>
                <td>{{ record.startDate }}</td>
                <td>{{ record.endDate }}</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 %}