2011-11-03 11:40:58 +01:00
|
|
|
\documentclass[a4paper,12pt,oneside,dutch]{isodoc}
|
|
|
|
|
2011-11-09 14:07:55 +01:00
|
|
|
% rubber: clean <%= @number %>.out
|
2011-11-03 16:11:07 +01:00
|
|
|
|
2011-11-03 11:40:58 +01:00
|
|
|
\usepackage{array}
|
2011-11-03 20:25:45 +01:00
|
|
|
\usepackage[utf8]{inputenc}
|
2011-11-03 11:40:58 +01:00
|
|
|
\setupdocument{
|
2011-11-03 20:25:45 +01:00
|
|
|
%% Language and style,
|
2011-11-03 11:40:58 +01:00
|
|
|
dutch,
|
|
|
|
fill,
|
|
|
|
fontpackage=pxfonts,
|
2011-11-03 20:25:45 +01:00
|
|
|
%% Company info.
|
2011-11-07 14:54:11 +01:00
|
|
|
company=<%= @company.name %>,
|
|
|
|
who=<%= @company.contact_name %>,
|
|
|
|
street=<%= @company.address_street %>,
|
|
|
|
zip=<%= @company.address_postal_code %>,
|
|
|
|
city=<%= @company.address_city %>,
|
|
|
|
country=<%= @company.country %>,
|
|
|
|
countrycode=<%= @company.country_code %>,
|
2011-11-03 11:40:58 +01:00
|
|
|
logoaddress={\hspace{-4.4em}
|
|
|
|
\begin{tabular}{l@{\ }l}
|
2011-11-07 17:45:22 +01:00
|
|
|
<% if @company.name.blank? %> \addresstext: & \who\\
|
2011-11-07 14:54:11 +01:00
|
|
|
<% else %> \addresstext: & \company \\
|
|
|
|
<% unless @company.contact_name.blank? %> \addresswhotext: & \who \\
|
|
|
|
<% end %><% end %> & \street\\
|
|
|
|
& \zip\ \city\\[.2em]
|
|
|
|
<% unless @company.phone.blank? %> \phonetext: & \lead\phone\\
|
|
|
|
<% end %><% unless @company.cell.blank? %> \cellphonetext: & \lead\cellphone\\
|
|
|
|
<% end %><% unless @company.email.blank? %> \emailtext: & \email\\[.2em]
|
|
|
|
<% end %><% unless @company.chamber.blank? %> \chambertext: & \chamber\\
|
|
|
|
<% end %><% unless @company.vatno.blank? %> \vatnotext: & \vatno
|
|
|
|
<% end %> \end{tabular}},
|
2011-11-03 20:25:45 +01:00
|
|
|
%% Footer.
|
2011-11-09 14:07:55 +01:00
|
|
|
<% unless @company.website.blank? %> footer,<%
|
|
|
|
end %> areacode=31,
|
2011-11-07 14:54:11 +01:00
|
|
|
phone=<%= @company.phone %>,
|
|
|
|
cellphone=<%= @company.cell %>,
|
|
|
|
email=<%= @company.email %>,
|
|
|
|
website=<%= @company.website %>,
|
2011-11-03 20:25:45 +01:00
|
|
|
%% Addressee info.
|
2011-11-03 11:40:58 +01:00
|
|
|
%foreign,
|
2012-01-03 16:51:07 +01:00
|
|
|
to={<%= @customer.name %>\\<% unless @customer.financial_contact.blank?
|
|
|
|
%><%= @customer.financial_contact
|
|
|
|
%>\\<% end %><%= @customer.address_street%>\\
|
2011-11-09 14:07:55 +01:00
|
|
|
<%= @customer.address_postal_code %> <%= @customer.address_city %>},
|
2011-11-03 11:40:58 +01:00
|
|
|
% Headlines.
|
2011-11-09 18:31:23 +01:00
|
|
|
date=<%= @invoice.created_at.to_formatted_s(:day_code) %>,
|
2011-11-09 14:07:55 +01:00
|
|
|
ourref=<%= @number %>,
|
2011-11-09 18:31:23 +01:00
|
|
|
<% period = @period.map { |p| I18n.l p, :format => :month_and_year }.uniq
|
2011-11-09 14:07:55 +01:00
|
|
|
case period.length
|
|
|
|
when 1 %> subject=Factuur <%= period.first %>,<%
|
|
|
|
when 2 %> subject=Factuur <%= period.join(" t/m ") %>,<%
|
|
|
|
end %>
|
2011-11-03 11:40:58 +01:00
|
|
|
yourref=,
|
2011-11-03 20:25:45 +01:00
|
|
|
%% Payment data.
|
2011-11-03 11:40:58 +01:00
|
|
|
term=30,
|
2011-11-07 14:54:11 +01:00
|
|
|
accountno=<%= @company.accountno %>,
|
|
|
|
accountname=<%= @company.accountname %>,
|
2012-01-03 16:51:07 +01:00
|
|
|
<% unless @company.accountiban.blank? %> iban=<% @company.accountiban %>,
|
|
|
|
<% end %><% unless @company.bank_bic.blank? %> bic=<% @company.bank_bic %>,
|
|
|
|
<% end %><% unless @company.vatno.blank? %> vatno=<%= @company.vatno %>,
|
2011-11-07 14:54:11 +01:00
|
|
|
<% end %><% unless @company.chamber.blank? %> chamber=<%= @company.chamber %>
|
|
|
|
<% end %>}
|
|
|
|
|
2012-01-03 16:51:07 +01:00
|
|
|
<% if @company.bank_name.present? %>
|
|
|
|
\renewcommand{\accountnotext}{<%= @company.bank_name %> rekeningnr}
|
|
|
|
<% end %>\newcommand{\addresstext}{adres}
|
2011-11-07 14:54:11 +01:00
|
|
|
\newcommand{\addresswhotext}{t.n.v.}
|
2011-11-03 11:40:58 +01:00
|
|
|
\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&\currency~#3&\currency~#4\\}
|
2012-01-02 12:47:36 +01:00
|
|
|
\newcommand{\ifcitem}[3]{#1&--&\currency~#3\\}
|
2011-11-03 11:40:58 +01:00
|
|
|
\newcommand{\ihsubtotal}[1]{\cmidrule[.0em]{4-4}%
|
|
|
|
\textit{Subtotaal}&&&\currency~#1\\}
|
2011-11-09 14:07:55 +01:00
|
|
|
\newcommand{\ihnosubtotal}[1]{\cmidrule[.0em]{4-4}&&&\\}
|
2011-12-23 21:17:44 +01:00
|
|
|
\newcommand{\ihvat}[1]{\textit{Btw-heffing <%= "%d\\%%" % @config["vat_rate"] %>}&&&\currency~#1\\}
|
2011-11-03 11:40:58 +01:00
|
|
|
\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}
|
2011-11-09 14:07:03 +01:00
|
|
|
<% subtotal = 0.0
|
|
|
|
@tasks.each do |task, line|
|
2012-01-02 12:47:36 +01:00
|
|
|
if line[1].blank?
|
2011-12-02 22:21:53 +01:00
|
|
|
%> \ifcitem{<%= task.comment_or_name %>}%
|
2012-01-02 15:16:54 +01:00
|
|
|
{<%= number_with_precision(line[0]) %>}%
|
|
|
|
{<%= number_with_precision(line[2]) %>}
|
2012-01-02 12:47:36 +01:00
|
|
|
<% else
|
2011-12-02 22:21:53 +01:00
|
|
|
%> \ihitem{<%= task.comment_or_name %>}%
|
2012-01-02 12:47:36 +01:00
|
|
|
{<%= number_with_precision(line[0]) %>}%
|
|
|
|
{<%= number_with_precision(line[1]) %>}%
|
|
|
|
{<%= number_with_precision(line[2]) %>}
|
|
|
|
<% end
|
2011-11-09 14:07:03 +01:00
|
|
|
subtotal += line[2]
|
|
|
|
end
|
2011-11-10 15:22:13 +01:00
|
|
|
if @company.vatno.blank?
|
2012-01-02 15:16:54 +01:00
|
|
|
vat = 0
|
|
|
|
%> \ihnosubtotal{} <%
|
2011-11-09 14:07:03 +01:00
|
|
|
else
|
2011-12-23 21:17:44 +01:00
|
|
|
vat = subtotal * @config["vat_rate"]/100.0 %>
|
2011-11-09 18:31:23 +01:00
|
|
|
\ihsubtotal{<%= number_with_precision(subtotal) %>}
|
|
|
|
\ihvat{<%= number_with_precision(vat) %>}<%
|
2011-11-09 14:07:03 +01:00
|
|
|
end %>
|
2011-11-09 18:31:23 +01:00
|
|
|
\ihtotal{<%= number_with_precision(subtotal + vat) %>}
|
2011-11-03 11:40:58 +01:00
|
|
|
\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}
|