Vendas detalhadas
[% IF sales_detailed.total > 0 -%]
----------------------------------------
          [% i18n("VENDAS DETALHADAS") %]
----------------------------------------
[% FOREACH date IN sales_detailed.docs.keys.sort -%]
==============
= [% date %] =
==============
[% FOREACH doc IN sales_detailed.docs.$date.headers -%]
[% doc.fo_doc_number.chars(17) | format("%-17s") %] [% doc.customer_name.chars(22) | format("%-22s") %]
[% doc.hour | format("%8s") %] [% doc.area_name.chars(6) | format("%-6s") %]/[% doc.table_num | format("%-3s") %] [% doc.clerk | format("%20s") %]

[% doc_id = doc.doc_id -%]
[% FOREACH prod IN sales_detailed.products.$doc_id -%]
  [% prod.product_name.chars(17) | format("%-17s") %] [% prod.quantity | format("%.3f") | format("%-6s") %] [% prod.vat | format("%.2f") | format("%5s") %] [% prod.total | format("%.2f") | format("%7s")  %]
[% END -%]

[% IF doc.doc_discount*1 > 0 -%]
[% i18n("DESCONTOS") | format("%-20s") %][% doc.doc_discount | format("%.2f") | format("%20s") %]
[% END -%]
[% i18n("TOTAL") | format("%-20s") %][% doc.doc_value | format("%.2f") | format("%20s") %]
----------------------------------------
[% END -%]
[% END -%]

[% i18n("TOTAL GLOBAL") %]: [% sales_detailed.total | format("%.2f") | format("%26s") %]
[% END -%]
