stoptime/templates/invoice.tex.erb

103 lines
3.0 KiB
Plaintext
Raw Normal View History

\documentclass[a4paper,12pt,oneside,dutch]{isodoc}
2011-11-03 16:11:07 +01:00
% rubber: clean <%= invoice_id %>.out
\usepackage{array}
\usepackage[utf8]{inputenc}
\setupdocument{
%% Language and style,
dutch,
fill,
fontpackage=pxfonts,
%% Company info.
company=,
who=Foo Bedrijf,
street=Zomaareenstraat 123,
city=Ergens,
zip=1234~ZZ,
country=The Netherlands,
countrycode=NL,
logoaddress={\hspace{-4.4em}
\begin{tabular}{l@{\ }l}
\addresstext: & \who\\
& \street\\
& \zip\ \city\\[.2em]
%\phonetext: & \lead\phone\\
\cellphonetext: & \lead\cellphone\\
\emailtext: & \email\\[.2em]
%\chambertext: & \chamber\\
%\vatnotext: & \vatno
\end{tabular}},
%% Footer.
%footer,
areacode=31,
%phone=12-3456789,
cellphone=6-12345678,
email=info@foobedrijf.nl,
%website=http://foobedrijf.nl,
%% Addressee info.
%foreign,
to={<%= customer.name %>\\<%= customer.address_street%>\\
<%= customer.address_postal_code %> <%= customer.address_city %>},
% Headlines.
date=<%= DateTime.now.to_formatted_s(:day_code) %>,
ourref=<%= invoice_id %>,
subject=Factuur <%= month.to_formatted_s(:month_and_year) %>,
yourref=,
%% Payment data.
term=30,
accountno=12.34.567.890,
accountname=Foo Bedrijf,
%vatno=\dots{}B01,
%chamber=\dots,
}
\newcommand{\addresstext}{adres}
\renewcommand{\chambertext}{KvK-nr}
\renewcommand{\datetext}{Factuurdatum}
\renewcommand{\emailtext}{e-mail}
\renewcommand{\invoicetext}{\Large\textbf{Factuur}}
\renewcommand{\ourreftext}{Factuurnummer}
\renewcommand{\referencetext}{factuurnummer}
\renewcommand{\vatnotext}{btw-nr}
\renewcommand{\websitetext}{website}
\newenvironment{ihtable}%
{\vskip1em\tabularx{\linewidth}{@{}X|@{\quad}r|@{\quad}r|@{\quad}r@{}}
\descriptiontext&Aantal uur&Uurtarief&\amounttext\ML}%
{\endtabularx}
\newcommand{\ihitem}[4]{#1&#2&\currency~#3&\currency~#4\\}
\newcommand{\ihsubtotal}[1]{\cmidrule[.0em]{4-4}%
\textit{Subtotaal}&&&\currency~#1\\}
\newcommand{\inosubtotal}{&&&\\}
\newcommand{\ihvat}[1]{\textit{Btw-heffing <%= VATRate %>\%}&&&\currency~#1\\}
\newcommand{\ihtotal}[1]{\cmidrule[.05em]{4-4}%
\textbf{\Totaltext}&&&\textbf{\currency~#1}}
\begin{document}
\invoice{
\hypersetup{pdftitle=\invoicetext\ naar\ \toname\ gedateerd \date\ (\ourref)}
\begin{ihtable}
<% subtotal = 0.0 %>
<% tasks.each do |task, line| %>
2011-11-03 16:11:21 +01:00
\ihitem{<%= task.name %>}{<%= "%.2f" % line[0] %>}%
{<%= "%.2f" % line[1] %>}{<%= "%.2f" % line[2] %>}
<% subtotal += line[2] %>
<% end %>
\ihsubtotal{<%= "%.2f" % subtotal %>}
%\inosubtotal
<% vat = subtotal * VATRate/100 %>
\ihvat{<%= "%.2f" % vat %>}
\ihtotal{<%= "%.2f" % (subtotal + vat) %>}
\end{ihtable}
\vspace{2em}
Ik verzoek u vriendelijk het verschuldigde bedrag binnen 30 dagen na
factuurdatum over te maken onder vermelding van het factuurnummer. \\
\accountdata
}
\end{document}