<div summary="Invoice Info">
    <!-- Div Styled Table -->
    <div class="div-table-first-row">
        <label i18n:translate="">Invoice To</label>
        <span tal:content="view/contact"></span>
    </div>
    <tal:table tal:repeat="field view/headers">
        <div tal:define="oddrow repeat/field/odd;"
             tal:attributes="class python:oddrow and 'div-table-right' or 'div-table-left'">
            <label i18n:translate="" tal:content="field/title">title</label>
            <span tal:content="field/value"></span>
        </div>
    </tal:table>
</div>
<br />

<table class="invoice-items" summary="Analyses List">
    <thead>
    <tr>
        <th colspan="2" i18n:translate="">Analyses</th>
        <th i18n:translate="">Price</th>
        <th i18n:translate="">VAT</th>
        <th i18n:translate="">Price incl VAT</th>
    </tr>
    </thead>
    <tbody>
    <!-- Displaying the analysis profiles. -->
    <tal:profiles repeat="profile view/profiles">
        <tal:profile>
            <tr class="profile">
                <td colspan="2" class="profile" tal:content="profile/name"></td>
                <!-- If profile's checkbox "Use Analysis Profile Price" is enabled, the profile prices
                will be displayed.-->

                <td tal:condition="profile/price" class="currency">
                    <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
                    <span tal:content="profile/price">0.00</span>
                </td>
                <td tal:condition="profile/price" class="currency">
                    <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
                    <span tal:content="profile/priceVat">0.00</span>
                </td>
                <td tal:condition="profile/price" class="currency">
                    <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
                    <span tal:content="profile/priceTotal">0.00</span>
                </td>
            </tr>
            <!-- Displaying profile's analysis services -->
            <tal:panalyses repeat="analysis profile/analyses">
                <tal:panalysis>
                    <tr class="panalysis">
                        <td colspan="2" class="title" tal:content="analysis/title">Title</td>
                        <!-- Analysis price -->
                        <td tal:condition="analysis/price" class="currency">
                            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
                            <span tal:content="analysis/price">0.00</span>
                        </td>
                        <!-- Analysis VAT amount -->
                        <td tal:condition="analysis/price" class="currency">
                            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
                            <span tal:content="analysis/priceVat">0.00</span>
                        </td>
                        <!-- Analysis price + VAT amount -->
                        <td tal:condition="analysis/price" class="currency">
                            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
                            <span tal:content="analysis/priceTotal">0.00</span>
                        </td>
                    </tr>
                </tal:panalysis>
            </tal:panalyses>
        </tal:profile>
    </tal:profiles>
    <!-- Displaying solo analysis. -->
    <tal:categories repeat="category view/analyses">
        <tal:category>
            <tr class="category">
                <td colspan="5" tal:content="category/name"></td>
            </tr>
            <tal:analyses repeat="analysis category/analyses">
                <tal:analysis>
                    <tr>
                        <td colspan="2" class="title" tal:content="analysis/title">Title</td>
                        <!-- Analysis price -->
                        <td class="currency">
                            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
                            <span tal:content="analysis/price">0.00</span>
                        </td>
                        <!-- Analysis VAT amount -->
                        <td class="currency">
                            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
                            <span tal:content="analysis/priceVat">0.00</span>
                        </td>
                        <!-- Analysis price + VAT amount -->
                        <td class="currency">
                            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
                            <span tal:content="analysis/priceTotal">0.00</span>
                        </td>
                    </tr>
                </tal:analysis>
            </tal:analyses>
        </tal:category>
    </tal:categories>
    <!-- Table line containing subtotal prices -->
    <tr class="totals">
        <td colspan="2" class="title" i18n:translate="">Subtotal</td>
        <td class="currency">
            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
            <span tal:content="view/subtotal"></span>
        </td>
        <td class="currency">
            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
            <span tal:content="view/subtotalVATAmount"></span>
        </td>
        <td class="currency">
            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
            <span tal:content="view/subtotalTotalPrice"></span>
        </td>
    </tr>
    <!-- Last table line containing total prices -->
    <tr class="totals">
        <td class="title" i18n:translate="">Total</td>
        <td class="currency">
            <span i18n:translate="">Discount %</span>
            <span tal:content="view/memberDiscount"></span>
        </td>
        <td class="currency">
            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
            <span >-</span>
            <span tal:content="view/discountAmount"></span>
        </td>
        <td class="currency">
            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
            <span tal:content="view/VATAmount"></span>
        </td>
        <td class="currency">
            <span tal:content="python:view.getPreferredCurrencyAbreviation()">R</span>
            <span tal:content="view/totalPrice"></span>
        </td>
    </tr>
    </tbody>
</table>
