diff --git a/templates/invoice.tex.erb b/templates/invoice.tex.erb index 38f6fb4..f6befaf 100644 --- a/templates/invoice.tex.erb +++ b/templates/invoice.tex.erb @@ -88,6 +88,13 @@ \newcommand{\ihtotal}[1]{\cmidrule[.05em]{4-4}% \textbf{\totaltext}&&&\textbf{\currency~#1}} +\newenvironment{istable}% + {\vskip1em\tabularx{\linewidth}{@{}X@{\quad}l@{\qquad}r@{}} + \descriptiontext&Datum&Aantal uur\ML}% + {\endtabularx} +\newcommand{\istask}[1]{\textbf{#1}\\} +\newcommand{\isitem}[3]{\quad #1\\} + \begin{document} \invoice{ @@ -128,4 +135,26 @@ \accountdata } +<% if @invoice.include_specification? %>{ + \newpage + + {\bfseries\scshape\Large Specificatie} + + Hieronder volgt een specificatie van gemaakte uren per taak per + uitgevoerde activiteit. + + \begin{istable} + <% @invoice.tasks.each do |task| +%> \istask{<%= task.comment_or_name %>}<% + task.time_entries.each do |time_entry| %> + \isitem{<%= time_entry.comment || "Geen opmerking" %>}% + {<%= time_entry.date.to_date %>}% + {<%= number_with_precision(time_entry.hours_total) %>}<% + end %>\\[\medskipamount]<% + end %> + \end{istable} + \label{LastPageOf\thelettercount} +<% end %>} +\letter{} + \end{document}