[BACK]Return to invoice.tex.tt CVS log [TXT][DIR] Up to [local] / RT / Invoicing

File: [local] / RT / Invoicing / invoice.tex.tt (download)

Revision 1.2, Sun Mar 20 01:34:42 2011 UTC (13 years, 2 months ago) by andrew
Branch: MAIN
Changes since 1.1: +35 -22 lines

add latex_encode to filter output all fields, ugly but ?
add detail lines under project, fee, expense and discounts

[% USE Latex -%]
[% FILTER latex("pdf") -%]
% $AFresh1: invoice.tex.tt,v 1.2 2011/03/20 01:34:42 andrew Exp $
\documentclass[oneside]{report}
\usepackage[top=1in, bottom=1in, left=.75in, right=.75in]{geometry}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{invoice}

\pagestyle{fancy}

\lhead{[% from.name | latex_encode %]}
\chead{Invoice \#\textbf{[% id | format('%06d') | latex_encode %]}}
\rhead{Page {\thepage}}

\lfoot{[% info1 | latex_encode %]}
\cfoot{}
\rfoot{[% info2 | latex_encode %]}

\begin{document}
\thispagestyle{empty}

\begin{multicols}{2}

{\large
[% from.name | latex_encode %]

[% IF from.attn -%]
    [% from.attn | latex_encode %]

[% END -%]
[% from.addr1 | latex_encode %]

[% IF from.addr2 -%]
    [% from.addr2 | latex_encode %]

[% END -%]
[% from.city | latex_encode %], [% from.state | latex_encode %] \ [% from.zip | latex_encode %]
}

\vspace{.75in}

{\Large
[% to.name | latex_encode %]

[% IF to.attn -%]
    [% to.attn | latex_encode %] 

[% END -%]
[% to.addr1 | latex_encode %]

[% IF to.addr2 -%]
    [% to.addr2 | latex_encode %]

[% END -%]
[% to.city | latex_encode %], [% to.state | latex_encode %] \ [% to.zip | latex_encode %]
}

\columnbreak

\begin{flushright}

\begin{tabular}{ | p{3in} | }
\hline
LOGO \\
\hline
\end{tabular}

\hfill
\vfill

\begin{tabular}{ | r l | }
\hline
Invoice No.  & \textbf{[% id | format('%06d') | latex_encode %]} \\
Invoice Date & \today \\
Page         & {\thepage} \\
\hline
\multicolumn{2}{|c|}{[% info1 | latex_encode %]} \\
\multicolumn{2}{|c|}{[% info2 | latex_encode %]} \\
\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 %]
    {\small [% f.detail | latex_encode %]}
   [% END -%]
  [%- END -%]
  [%- FOR e IN p.expenses %]
   \EBC{[% e.contents | latex_encode %]}{[% e.amount | latex_encode %]}
   [%- IF e.detail %]
    {\small [% e.detail | latex_encode %]}
   [% END -%]
  [%- END -%]
  [%- FOR d IN p.discounts %]
   \Discount{[% d.contents | latex_encode %]}{[% d.amount | latex_encode %]}
   [%- IF d.detail %]
    {\small [% d.detail | latex_encode %]}
   [% END -%]
  [%- END -%]
 [%- END %]
\end{invoice}

\end{document}
[% END -%]