{% set waybill_sub_total = 0 %} {% set waybill_vat = 0 %} {% set waybill_total = 0 %}

Waybills:

{% for waybill_info in info_arr %} {% set waybill_sub_total = waybill_sub_total + waybill_info['totals']['sub_total'] %} {% set waybill_vat = waybill_vat + waybill_info['totals']['vat'] %} {% set waybill_total = waybill_total + waybill_info['totals']['total'] %} {% endfor %}
WaybillPeriodDateServiceSub-TotalVatTotal
{{ waybill_info['info']['waybill_no'] }} {{ waybill_info['info']['period'] }} {{ waybill_info['info']['date']|date("Y/m/d") }} {{ waybill_info['info']['waybill_srv'] }} {{ waybill_info['totals']['sub_total']|number_format(2, '.', ' ') }} {{ waybill_info['totals']['vat']|number_format(2, '.', ' ') }} {{ waybill_info['totals']['total']|number_format(2, '.', ' ') }}

Adjustments:

{% for waybill_info in info_arr %} {% set waybill_sub_total = waybill_sub_total + waybill_info['adjustments']['ex_vat'] %} {% set waybill_vat = waybill_vat + waybill_info['adjustments']['vat'] %} {% set waybill_total = waybill_total + waybill_info['adjustments']['inc_vat'] %} {% endfor %}
WaybillPeriodDateInfoSub-TotalVatTotal
{{ waybill_info['info']['waybill_no'] }} {{ waybill_info['info']['period'] }} {{ waybill_info['info']['date']|date("Y/m/d") }} Forward Credit {{ waybill_info['adjustments']['ex_vat']|number_format(2, '.', ' ') }} {{ waybill_info['adjustments']['vat']|number_format(2, '.', ' ') }} {{ waybill_info['adjustments']['inc_vat']|number_format(2, '.', ' ') }}

Credits:

{% for credit_info in credit_arr %} {% set waybill_sub_total = waybill_sub_total - credit_info['sub_total'] %} {% set waybill_vat = waybill_vat - credit_info['vat'] %} {% set waybill_total = waybill_total - credit_info['total'] %} {% endfor %}
WaybillPeriodDateCreditReasonSub-TotalVatTotal
{{ credit_info['waybill_no'] }} {{ credit_info['period'] }} {{ credit_info['date']|date("Y/m/d") }} {{ credit_info['credit_note'] }} {{ credit_info['reason'] }} {{ (0 - credit_info['sub_total'])|number_format(2, '.', ' ') }} {{ (0 - credit_info['vat'])|number_format(2, '.', ' ') }} {{ (0 - credit_info['total'])|number_format(2, '.', ' ') }}
Waybill Total:{{ waybill_sub_total|number_format(2, '.', ' ') }}{{ waybill_vat|number_format(2, '.', ' ') }}{{ waybill_total|number_format(2, '.', ' ') }}