% Copyright (c) 2006, Chris Parsons (chris@edendevelopment.co.uk) % All rights reserved. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided that the following conditions are met: % % * Redistributions of source code must retain the above copyright notice, % this list of conditions and the following disclaimer. % * Redistributions in binary form must reproduce the above copyright notice, % this list of conditions and the following disclaimer in the documentation % and/or other materials provided with the distribution. % * Neither the name of Chris Parsons nor the names of its contributors may be % used to endorse or promote products derived from this software without % specific prior written permission. % % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" % AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE % IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE % ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE % LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR % CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF % SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS % INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN % CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) % ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE % POSSIBILITY OF SUCH DAMAGE. \documentclass[portrait,12pt,a4paper]{report} \usepackage[english]{babel} \usepackage{color} % Latex spread mode \newcommand{\val}[2]{#1} \newcommand{\var}[3]{#1} \newcommand{\eva}[1]{ } \renewcommand{\encodingdefault}{T1} \renewcommand{\rmdefault}{phv} \evensidemargin 0.0in \oddsidemargin 0.0in \textwidth 6.5in \topmargin -0.5in \textheight 9.5in \usepackage{fancyhdr} \usepackage{graphicx} \pagestyle{fancy} \fancyhf{} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} % Include bg image if we've got one <% if File.exists?('background.pdf') %> \fancyfoot[L]{\vskip 0.64in\hskip -1in\begin{picture}(0,0)\includegraphics{background.pdf}\end{picture}} <% end %> \begin{document} \vspace*{1cm} {\noindent <%= invoice.address.gsub(/, /, '\\\\\\') %>\\ } \noindent <%= invoice.date.strftime('%d %b %Y') %> \vspace{1cm} \centerline{\bf \large INVOICE} \vspace{1cm} \eva{(ch 'item)} \begin{table}[h] \begin{center} \begin{tabular}{lrrr} Item & Rate & Count & TOTAL\\ \hline\\ <% invoice.items.each do |line| %> <%= line.what %> <%= line.date ? "(#{line.date.strftime('%d %b')})" : '' %> & <%= "%4.2f" % invoice.to_currency(line.rate) %> & <%= "%4.2f" % line.count %> & <%= invoice.to_currency(line.total).currency_symbol %><%= "%4.2f" % invoice.to_currency(line.total) %>\\ <% end %> \hline\\ TOTAL ex VAT & & & <%= invoice.total.currency_symbol %><%= "%4.2f" % invoice.total %>\\ VAT & & & <%= invoice.total.currency_symbol %><%= "%4.2f" % invoice.total_vat %>\\ \hline\\ TOTAL inc VAT & & & \textbf{<%= invoice.total.currency_symbol %><%= "%4.2f" % (invoice.total + invoice.total_vat) %>}\\ \hline\hline\\ \end{tabular} \end{center} \end{table} \vspace{1cm} \begin{center} {\small Invoice \#: <%= invoice.code %>\\} {\small Payment due within 30 days of date on invoice\\ Please pay by wire to 40-46-39 51591215 or by cheque on return\\(payable to Eden Development (UK) Ltd) VAT Registration No: 845 0397 19} \end{center} \newpage \end{document}