[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.3, Sun Mar 20 05:20:11 2011 UTC (13 years, 2 months ago) by andrew
Branch: MAIN
Changes since 1.2: +16 -12 lines

there is only 1 discount, not a running total. SO I have to add them up myself.
Add totals to the first page of the invoice

[% USE Latex -%]
[% FILTER latex("pdf") -%]
% $AFresh1: invoice.tex.tt,v 1.3 2011/03/20 05:20:11 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 \\
Invoice Total & [% total | format('%.2f') | latex_encode %] \\
[% IF past_due -%]
  Past Due    & [% past_due | format('%.2f') | latex_encode %] \\
[%- END %]
[%- IF total_due -%]
  Total Due   & [% total_due | format('%.2f') | latex_encode %] \\
[%- END %]
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 %]
    \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 %]
 [%- IF discount %]
  \\\Discount{[% discount.contents | latex_encode %]}{[% discount.amount | latex_encode %]}%
 [%- END %]
\end{invoice}

\end{document}
[% END -%]