{% set doc_fz = constant('idOrderController::DOC_FZ') %}
{% set doc_mm = constant('idOrderController::DOC_MM') %}
{% set doc_zd = constant('idOrderController::DOC_ZD') %}
{% set doc_rw = constant('idOrderController::DOC_RW') %}
{% set doc_pz = constant('idOrderController::DOC_PZ') %}

<table class="ui celled table" id="dataTable" >
    <thead>
    <tr>
        <th>Lp.</th>
        <th>Id zamówienia</th>
        <th>ZD</th>
        <th>MM</th>
        <th>FvZ</th>
        <th>FZ zaliczkowa</th>
        <th>RW</th>
        <th>PZ</th>
    </tr>
    </thead>
    <tbody>
    {% for id, document in documents %}
    <tr>
        <td>{{ loop.index }}.</td>
        <td>{{ id }}</td>
        <td>{% if document[doc_zd] is defined %}{{ document[doc_zd].dok_WartBrutto | number_format(2, '.') }}{% endif %}</td>
        <td>{% if document[doc_mm] is defined %}{{ document[doc_mm].dok_WartBrutto | number_format(2, '.') }}{% endif %}</td>
        <td>{% if document[doc_fz] is defined %}{{ document[doc_fz].dok_WartBrutto | number_format(2, '.') }}{% endif %}</td>
        <td></td>
        <td>{% if document[doc_rw] is defined %}{{ document[doc_rw].dok_WartBrutto | number_format(2, '.')  }}{% endif %}</td>
        <td>{% if document[doc_pz] is defined %}{{ document[doc_pz].dok_WartBrutto | number_format(2, '.')  }}{% endif %}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>