File: [local] / RT / Invoicing / invoice.tex.tt (download)
Revision 1.18, Sun Aug 2 01:05:31 2020 UTC (3 years, 11 months ago) by afresh1
Branch: MAIN
CVS Tags: HEAD Changes since 1.17: +4 -3 lines
Improve example test script
|
[% USE Latex -%]
[% FILTER latex("pdf") -%]
% $AFresh1: invoice.tex.tt,v 1.18 2020/08/02 01:05:31 afresh1 Exp $
\documentclass[oneside]{report}
\usepackage{graphicx}
\usepackage[top=1in, bottom=1in, left=.75in, right=.75in]{geometry}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{invoice}
\pagestyle{fancy}
\lhead{[% organization | latex_encode %]}
\chead{Invoice \#\textbf{[% id | format('%06d') | latex_encode %]}}
\rhead{Page {\thepage}}
\lfoot{[% info.0 | latex_encode(except = "\\{}") %]}
\cfoot{}
\rfoot{[% info.1 | latex_encode(except = "\\{}") %]}
\begin{document}
\thispagestyle{empty}
\vspace*{-.75in}
\begin{multicols}{2}
\parbox[t][1.625in]{\linewidth}{\large [% from | latex_encode(except = "\\{}<>") %] }
\parbox[t][1.5in]{\linewidth}{\large [% to | latex_encode(except = "\\{}<>") %] }
\columnbreak
\begin{flushright}
\includegraphics{[% logo %]}
\hfill
\vfill
\begin{tabular}{ | r l | }
\hline
Invoice No. & \textbf{[% id | format('%06d') | latex_encode %]} \\
%Page & {\thepage} \\
[%- IF invdate %]
Invoice Date & [% invdate.strftime('%B %d, %Y') | latex_encode %] \\
[%- END %]
[%- IF start %]
From & [% start.strftime('%B %d, %Y') | latex_encode %] \\
[%- END %]
[%- IF end- %]
Through & [% end.strftime('%B %d, %Y') | latex_encode %] \\
[%- END %]
[% IF total -%]
Invoice Total & [% total | format('$%.2f') | latex_encode %] \\
[%- END %]
[% IF past_due -%]
Past Due & [% past_due | format('$%.2f') | latex_encode %] \\
[%- END %]
[% IF unpaid -%]
Unpaid & [% unpaid | format('$%.2f') | latex_encode %] \\
[%- END %]
[%- IF total_due -%]
Total Due & [% total_due | format('$%.2f') | latex_encode %] \\
[%- END %]
\hline
[%- FOR line IN info %]
\multicolumn{2}{|c|}{[% line| latex_encode(except = "\\{}") %]} \\
[% END -%]
\hline
\end{tabular}
\end{flushright}
\end{multicols}
\begin{invoice}{USD}{0}
[%- FOR p IN projects %]
\ProjectTitle{[% p.title | latex_encode %]}%
[%- IF p.detail %]
\\\multicolumn{5}{l}{[% p.detail | latex_encode %]}\\%
[% END -%]
[%- FOR f IN p.fees %]
\Fee{[% f.contents | latex_encode %]}{[% f.rate | latex_encode %]}{[% f.count | latex_encode %]}%
[%- IF f.detail %]
\multicolumn{5}{l}{\small \textbullet \ [% f.detail | latex_encode %]}\\%
[% END -%]
[%- END -%]
[%- FOR e IN p.expenses %]
\EBC{[% e.contents | latex_encode %]}{[% e.amount | latex_encode %]}%
[%- IF e.detail %]
\multicolumn{5}{l}{\small \textbullet \ [% e.detail | latex_encode %]}\\%
[% END -%]
[%- END -%]
[%- END # projects %]
[%- IF discount %]
\\\Discount{[% discount.contents | latex_encode %]}{[% discount.amount | latex_encode %]}\\%
[%- END %]
\end{invoice}
\end{document}
[% END -%]