{% load latex %} {% autoescape off %} \documentclass{mitvoucher} \signatoryemail{esp-treasurer@mit.edu} \usepackage{pdfpages} \newcommand{\documentationpath}{%templatetag openbrace%}{{MEDIA_ROOT}}{%templatetag closebrace%} \begin{document} \section{Summary Table} The following {{vouchers|length}} vouchers (total: \${{total}}) are included in this run:\\ \begin{tabular}{r|l|l|r|p{2in}} Account & Name & Email & Amount & Description \\ {% for f in vouchers %} {{f.account|texescape}} & {{f.first_name|texescape}} {{f.last_name|texescape}} & {{f.email_address|texescape}} & {{f.amount|texescape}} & {{f.description}} \\ {% endfor %} \end{tabular} This run generated at {% now "H:i" %} on {% now "l F d, Y" %}. The following pages contain the vouchers themselves. \clearpage {% for f in vouchers %} \begin{voucher} \groupname{ {{f.group_name|texescape}} } \costobject{ {{f.account|texescape}} } \signatory{ {{f.signatory|texescape}} } \bycheck{} \payablefirst{ {{f.first_name|texescape}} } \payablelast{ {{f.last_name|texescape}} } \email{ {{f.email_address|texescape}} } {% if f.mailing_addr_lines.0 %}\mailone{ {{f.mailing_addr_lines.0|texescape}} } {% endif %}{% if f.mailing_addr_lines.1 %}\mailtwo{ {{f.mailing_addr_lines.1|texescape}} } {% endif %}{% if f.mailing_addr_lines.2 %}\mailthree{ {{f.mailing_addr_lines.2|texescape}} } {% endif %}\amt{\${{f.amount|texescape}} } \desc{ {{f.description|texescape}} } \gl{ {{f.gl|texescape}} } \end{voucher} {% if f.documentation %} \includepdf[pages=-]{\documentationpath/{{f.documentation.backing_file}}} {% endif %} {% endfor %} \end{document} {% endautoescape %}