=================================================================== RCS file: /cvs/RT/Invoicing/invoice.tex.tt,v retrieving revision 1.1 retrieving revision 1.18 diff -u -r1.1 -r1.18 --- RT/Invoicing/invoice.tex.tt 2011/03/19 23:27:16 1.1 +++ RT/Invoicing/invoice.tex.tt 2020/08/02 02:05:31 1.18 @@ -1,7 +1,8 @@ [% USE Latex -%] [% FILTER latex("pdf") -%] -% $AFresh1$ +% $AFresh1: invoice.tex.tt,v 1.17 2015/05/08 01:04:08 andrew Exp $ \documentclass[oneside]{report} +\usepackage{graphicx} \usepackage[top=1in, bottom=1in, left=.75in, right=.75in]{geometry} \usepackage{multicol} \usepackage{fancyhdr} @@ -9,74 +10,60 @@ \pagestyle{fancy} -\lhead{[% from.name %]} -\chead{Invoice \#\textbf{[% id | format('%06d') %]}} +\lhead{[% organization | latex_encode %]} +\chead{Invoice \#\textbf{[% id | format('%06d') | latex_encode %]}} \rhead{Page {\thepage}} -\lfoot{[% info1 %]} +\lfoot{[% info.0 | latex_encode(except = "\\{}") %]} \cfoot{} -\rfoot{[% info2 %]} +\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 = "\\{}<>") %] } -{\large -[% from.name %] +\parbox[t][1.5in]{\linewidth}{\large [% to | latex_encode(except = "\\{}<>") %] } -[% IF from.attn -%] - [% from.attn %] - -[% END -%] -[% from.addr1 %] - -[% IF from.addr2 -%] - [% from.addr2 %] - -[% END -%] -[% from.city %], [% from.state %] \ [% from.zip %] -} - -\vspace{.75in} - -{\Large -[% to.name %] - -[% IF to.attn -%] - [% to.attn %] - -[% END -%] -[% to.addr1 %] - -[% IF to.addr2 -%] - [% to.addr2 %] - -[% END -%] -[% to.city %], [% to.state %] \ [% to.zip %] -} - \columnbreak \begin{flushright} -\begin{tabular}{ | p{3in} | } -\hline -LOGO \\ -\hline -\end{tabular} +\includegraphics{[% logo %]} \hfill \vfill \begin{tabular}{ | r l | } \hline -Invoice No. & \textbf{[% id | format('%06d') %]} \\ -Invoice Date & \today \\ -Page & {\thepage} \\ +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 -\multicolumn{2}{|c|}{[% info1 %]} \\ -\multicolumn{2}{|c|}{[% info2 %]} \\ +[%- FOR line IN info %] +\multicolumn{2}{|c|}{[% line| latex_encode(except = "\\{}") %]} \\ +[% END -%] \hline \end{tabular} @@ -85,18 +72,33 @@ \end{multicols} \begin{invoice}{USD}{0} - [%- FOR p IN projects %] - \ProjectTitle{[% p.title %]} + +[%- 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 %]}{[% f.rate %]}{[% f.count %]} + \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 %]}{[% e.amount %]} + \EBC{[% e.contents | latex_encode %]}{[% e.amount | latex_encode %]}% + [%- IF e.detail %] + \multicolumn{5}{l}{\small \textbullet \ [% e.detail | latex_encode %]}\\% + [% END -%] [%- END -%] - [%- FOR d IN p.discounts %] - \Discount{[% d.contents %]}{[% d.amount %]} - [%- END -%] - [%- END %] + +[%- END # projects %] + +[%- IF discount %] + \\\Discount{[% discount.contents | latex_encode %]}{[% discount.amount | latex_encode %]}\\% +[%- END %] + \end{invoice} \end{document}