Skip to content

Instantly share code, notes, and snippets.

@tristancollins
Created August 2, 2014 16:42
Show Gist options
  • Save tristancollins/feb8d9797bcee56ae31a to your computer and use it in GitHub Desktop.
Save tristancollins/feb8d9797bcee56ae31a to your computer and use it in GitHub Desktop.
Latex invoice template or VAT-registered consultants
\doc­u­ment­class[11pt,a4paper]{art­icle}
\usep­ack­age{dat­e­time}
\usep­ack­age{fp}
\usep­ack­age{booktabs}
\usep­ack­age{ragged2e}
\usep­ack­age{longt­able}
\usep­ack­age{hhline}
\newd­ate­format{mydate}{\ordinal{DAY} \month­name[\THEMONTH] \THEYEAR}
%\usepackage[utf8x]{inputenc}
\usep­ack­age[T1]{fon­tenc}
\usep­ack­age{lmod­ern}
\usep­ack­age{mar­vosym}
\usep­ack­age{ifpdf}
\ifpdf
\usep­ack­age[pdf­tex]{graph­icx}
\else
\usep­ack­age[dvips]{graph­icx}\fi
\page­style{empty}
%\usepackage{invoice}
%\usepackage[scale=0.8]{geometry}
\usep­ack­age[margin=1in, top=1in, bottom=1in]{geo­metry}
\setlength{\parindent}{0pt}
\addtolength{\parskip}{5pt}
\def\first­name{FIRST­NAME}
\def\fam­ily­name{LAST­NAME}
\def\FileAu­thor{\first­name \fam­ily­name}
\def\File­Title{XXXX Invoice}
\def\File­Sub­ject{XXXX Invoice}
\def\FileKeyWords{XXXX Invoice}
\new­counter{cnt}
\set­counter{cnt}{0}
\def\inc{\step­counter{cnt}\thecnt}
\gdef\TotalAct{0} % Activ­ity total
\gdef\Total­Exp{0} % Expense total
\gdef\Total­VAT{0} % VAT total
\gdef\Total­Grand{0} % Grand total
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ACTIV­IT­IES
\new­com­mand{\activ­ity}[3]{%
#1 &#2 &#3 &\FPmul\temp{#2}{#3}\FPround\temp{\temp}{2}\temp % #2 x #3, roun­ded to 2 decimal places and stored as \temp
%% Total­ize
\FPadd\total{\TotalAct}{\temp}% Add \temp to \total
\FPround\total{\total}{2}% Round \total to 2 decimal places
\global\let\TotalAct\total% Sets \TotalHT = \total
\\ }
\new­com­mand{\totalttc}{
\TotalAct }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EXPENSES
\new­com­mand{\expense}[2]{%
#1 & & &\FPmul\temptwo{1}{#2}\FPround\temptwo{\temptwo}{2}\temptwo % #2 x #3, roun­ded to 2 decimal places and stored as \temp
%% Total­ize
\FPadd\totaltwo{\Total­Exp}{\temptwo}% Add \temp to \total
\FPround\totaltwo{\totaltwo}{2}% Round \total to 2 decimal places
\global\let\Total­Exp\totaltwo% Sets \TotalHT = \total
\\ }
\new­com­mand{\totalttctwo}{
\Total­Exp }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VAT
\new­com­mand{\VAT}{%
%VAT (20\%) &&&\FPadd\tempthree{\totalttc}{\totalttctwo}\FPround\tempthree{\tempthree}{2}\tempthree % #2 x #3, roun­ded to 2 decimal places and stored as \temp
VAT (20\%) &&&\FPadd\temp­three{\totalttc}{\totalttctwo}\FPmul\temp­three{\temp­three}{0.2}\FPround\temp­three{\temp­three}{2}\temp­three % #2 x #3, roun­ded to 2 decimal places and stored as \temp
%% Total­ize
\FPadd\total­three{\Total­VAT}{\temp­three}% Add \temp to \total
\FPround\total­three{\total­three}{2}% Round \total to 2 decimal places
\global\let\Total­VAT\total­three% Sets \TotalHT = \total
\\ }
\new­com­mand{\totalttcthree}{
\Total­VAT }
\begin{doc­u­ment}
\sffam­ily % for use with a resume using sans serif fonts;
%\rmfam­ily % for use with a resume using serif fonts;
\hfill%
%%%%%%%%%%% FROM ADDRESS
\begin{minipage}[t]{.6\tex­twidth}
\rag­ge­dleft%
{\bfser­ies Com­pany Name}\\[.35ex]
\small\itshape%
Address 1\\
Address 2, POST­CODE\\[.35ex]
\Tele­fon~PHONE NUM­BER\\
\Let­ter~{EMAIL ADDRESS}
\end{minipage}\\[1em]
%%%%%%%%%%% TO ADDRESS
\begin{minipage}[t]{.4\tex­twidth}
\raggedright%
{\bfser­ies Invoiced Com­pany}\\[.35ex]
\small\itshape%
Address 1\\ Address 2 \\ Address 3, POST­CODE
\end{minipage}\\[1em]
%%%%%%%%%% INVOICE NUM­BER
\begin{minipage}[t]{.4\tex­twidth}
\bfser­ies Invoice Num­ber: {\texttt{XXX0000}}
\end{minipage}
%
%\hfill % US style
\\[1em] % UK style
\begin{minipage}[t]{.4\tex­twidth}
%\rag­ge­dleft % US style
%\mydate\today
\form­at­date{19}{8}{2013}
\end{minipage}\\[1em]
%\raggedright
Dear XXXXX,\\[0.75em]
%
Please find costs for con­sultancy ser­vices provided for the period 1\textsu­per­script{st} August to 19\textsu­per­script{th} August 2013.
%%%% INVOICE PART
\begin{longt­able}{p{8cm}rrr}
%\toprule
\mul­ti­column{4}{c}{\textbf{Pro­ject Name}}\\
\rule{0pt}{4ex}{\bfser­ies Activ­ity} & Rate & Qty & Amount (\textster­ling)\\
\midrule
%%%% PUT YOUR DAYS WORKED AND RATE HERE
\activ­ity{Activ­ity 1}{250.00}{12}
\activ­ity{Activ­ity 2}{20.00}{3.5}
\rule{0pt}{4ex}{\bfser­ies Expenses} & & & Amount (\textster­ling)\\
\midrule
%%%% PUT YOUR EXPENSES HERE
\expense{Flights}{123.45}
\expense{Hotels}{123.45}
\expense{Trains}{74.15}
\expense{Sub­sist­ence}{17.63}
\expense{Taxis}{640.90}
\expense{Calls and Data}{230.54}
\midrule
Sum Fees &&& \totalttc\\
Sum Expenses &&& \totalttctwo\\
\VAT
%\bot­tom­rule
\hhline{====}
{\bfser­ies Total} &&& \FPadd\tem­p­four{\totalttc}{\totalttctwo}\FPround\tem­p­four{\tem­p­four}{2}\FPadd\tem­p­four{\tem­p­four}{\totalttcthree}\FPround\tem­p­four{\tem­p­four}{2}{\bfser­ies \tem­p­four} \\
%\bot­tom­rule
\end{longt­able}
If this could paid to the fol­low­ing account:\\
BANK ADDRESS\\
Sort Code XX XX XX\\
Account Num­ber XXXXXXXXX
For and on behalf of XXXXXXXXXX,\\[0.75em]
{\bfser­ies NAME}
%
\vfill%
Com­pany Regis­tra­tion Num­ber: XXXXXXXXXXX \\
Registered Office Address: XXXXXXXXXXX\\
VAT Num­ber XXXXXXXXXXXXX
%{\slshape Enclos­ure}
\end{doc­u­ment}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment