Documentos Manuais Lançados
[% IF manual_docs.keys.size > 0 -%]
----------------------------------------
          [% i18n("DOCUMENTOS MANUAIS") %]
----------------------------------------
[% doc_totals = 0 -%]
[% doc_vats = 0 -%]
[% FOREACH date IN manual_docs.dates.keys.sort -%]
[% i18n("LANÇADOS EM") %]: [% date %]

[% i18n("DATA") | format("%-10s") %]|[% i18n("C/ IVA") | format("%-7s") %]|[% i18n("IVA") | format("%-7s") %]| [% i18n("DOCUMENTO") %]
----------'-------'-------'-------------
[% FOREACH mdate IN manual_docs.dates.$date.docs.keys.sort -%]
[% FOREACH doc IN manual_docs.dates.$date.docs.$mdate.keys.sort -%]
[% doc_total = 0 -%]
[% doc_total_wo_vat = 0 -%]
[% vat_total = 0 -%]
[% IF manual_docs.dates.$date.docs.$mdate.$doc.manualdoc_type == 'recover' -%]
[% doc_total = manual_docs.dates.$date.docs.$mdate.$doc.total -%]
[% vat_total = manual_docs.dates.$date.docs.$mdate.$doc.total - manual_docs.dates.$date.docs.$mdate.$doc.total_wo_vat -%]
[% ELSE -%]
[% doc_total = manual_docs.dates.$date.docs.$mdate.$doc.manualdoc_total_w_vat -%]
[% vat_total = manual_docs.dates.$date.docs.$mdate.$doc.manualdoc_total_vat -%]
[% END -%]
[% doc_totals = doc_totals + doc_total -%]
[% doc_vats = doc_vats + vat_total -%]
[% doc_total_wo_vat = doc_total_wo_vat + (doc_totals - doc_vats) -%]
[% manual_docs.dates.$date.docs.$mdate.$doc.manualdoc_date %]|[% doc_total | format("%.2f") | format("%7s") %]|[% vat_total | format("%.2f") | format("%7s") %]| [% manual_docs.dates.$date.docs.$mdate.$doc.manualdoc_serie %]/[% manual_docs.dates.$date.docs.$mdate.$doc.manualdoc_docnum %]
[% END -%]
[% END -%]

[% END -%]
          |[% i18n("C/ IVA") | format("%-7s") %]|[% i18n("IVA") | format("%-7s") %]| [% i18n("S/ IVA") | format("%-7s") %]
----------'-------'-------'-------------
TOTAL     '[% doc_totals | format("%.2f") | format("%7s") %]'[% doc_vats | format("%.2f") | format("%7s") %]'[% doc_total_wo_vat | format("%.2f") | format("%7s") %]
[% END -%]
