\documentclass[paper=a4,fontsize=11pt,DIV=12]{scrlttr2}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[gen]{eurosym}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage{dcolumn}
\usepackage{booktabs}
\usepackage[english]{babel}

\DeclareUnicodeCharacter{20AC}{\euro{}}
% for narrow nobreak space created by gcinvoice formatting numbers
\DeclareUnicodeCharacter{202F}{\,}

\LoadLetterOption{DINmtext}
\KOMAoptions{enlargefirstpage=true,fromalign=right,fromphone=true,fromemail=true,backaddress=true,parskip=half*}

\setkomavar{fromname}{Kleopatra}
\setkomavar{fromaddress}{%
  Brucheion\\
  Alexandria
  }
\setkomavar{fromphone}{+987654321}
\setkomavar{fromemail}{foo@invalid.invalid}

\begin{document}

\begin{letter}{To\\
  Gaius Julius Caesar\\
    Palatin 7\\
    Rome\\
}

\setkomavar{subject}{%
  Items delivered in March}
\setkomavar{invoice}{1}

\opening{Dear user of gcinvoice,}

this invoice template demonstrates some features of gcinvoice, and is also used
by the test suite.
The \emph{special discount} demonstrates that arbitrary python expressions can be
used.
It also shows how to calculate and format numbers.
Prices are in €.

\begin{tabular}[t]{D{,}{,}{2}p{22em}D{,}{,}{2}D{,}{,}{2}D{,}{,}{2}D{,}{,}{2}}
  \multicolumn{1}{c}{Quantity} &	Item &	\multicolumn{1}{c}{Price} &
  \multicolumn{1}{c}{Discount} &      \multicolumn{1}{c}{Taxes} &      \multicolumn{1}{c}{Amount}\\ \midrule
10 &   Without taxes and discount &   100,00 & 0,00 & 0,00 &   1.000,00 \\
10 &   With excluded taxes, without discount &   100,00 & 0,00 & 350,00 &   1.000,00 \\
10 &   Without taxes, with percent discount &   100,00 & 50,00 & 0,00 &   950,00 \\
10 &   Without taxes, with value discount &   100,00 & 5,00 & 0,00 &   995,00 \\
10 &   With included taxes &   100,00 & 0,00 & 269,23 &   730,77 \\
10 &   With excluded taxes, pretax percent discount &   100,00 & 50,00 & 335,00 &   950,00 \\
10 &   With included taxes, pretax percent discount &   100,00 & 36,54 & 258,27 &   694,23 \\
10 &   With excluded taxes, pretax value discount &   100,00 & 5,00 & 348,50 &   995,00 \\
10 &   With included taxes, pretax value discount &   100,00 & 5,00 & 267,73 &   725,77 \\
10 &   With excluded taxes, sametime percent discount &   100,00 & 50,00 & 350,00 &   950,00 \\
10 &   With included taxes, sametime percent discount &   100,00 & 36,54 & 269,23 &   694,23 \\
10 &   With excluded taxes, sametime value discount &   100,00 & 5,00 & 350,00 &   995,00 \\
10 &   With included taxes, sametime value discount &   100,00 & 5,00 & 269,23 &   725,77 \\
10 &   With excluded taxes, posttax percent discount &   100,00 & 67,50 & 334,42 &   948,08 \\
10 &   With included taxes, posttax percent discount &   100,00 & 50,00 & 257,69 &   692,31 \\
10 &   With excluded taxes, posttax value discount &   100,00 & 5,00 & 348,85 &   996,15 \\
10 &   With included taxes, posttax value discount &   100,00 & 5,00 & 268,08 &   726,92 \\
\midrule
     &	Net amount &		&       &       &	14.769,23\\
     &	+ Taxes &	&       &       &	4.276,23 \\ \cmidrule{6-6}
     &	Gross amount &		&       &       &	19.045,46 \\
     &	\multicolumn{2}{l}{my special discount (not in Gnucash)} &      &   &	1.476,92 \\ \cmidrule{6-6}
     &	Final amount &  &       &	& 17.568,54
\end{tabular}

\closing{Best Regards}

\end{letter}

\end{document}
