2016-12-09 11:01:34 +01:00
|
|
|
\documentclass{scrlttr2}
|
2016-11-19 12:16:47 +01:00
|
|
|
\usepackage[T1]{fontenc}
|
|
|
|
\usepackage[utf8]{inputenc}
|
|
|
|
\usepackage[ngerman]{babel}
|
2016-11-19 14:06:03 +01:00
|
|
|
\usepackage[right]{eurosym}
|
2016-12-09 11:01:34 +01:00
|
|
|
\usepackage{tabularx,booktabs}
|
2016-11-19 14:06:03 +01:00
|
|
|
\usepackage{spreadtab}
|
2016-12-09 11:01:34 +01:00
|
|
|
\usepackage{filecontents}
|
2016-11-19 20:30:10 +01:00
|
|
|
\STautoround*{2}
|
2016-12-09 11:01:34 +01:00
|
|
|
\usepackage{csvsimple}
|
2016-11-19 14:43:31 +01:00
|
|
|
|
2016-11-19 20:30:10 +01:00
|
|
|
%\begin{filecontents*}{test.csv}
|
|
|
|
%name,steuersatz,anzahl,betrag,artikelnr,konfektionierung,beschreibung
|
|
|
|
%Dings,19,2,23.42,1337,Größe M,Ein Dings
|
|
|
|
%Bums,7,1,5.00,2342,Dunkelweiß,,
|
|
|
|
%Vortrag,0,100,13.37,0001,schön laut,,
|
|
|
|
%\end{filecontents*}
|
|
|
|
|
2016-12-09 11:01:34 +01:00
|
|
|
\begin{filecontents*}{data.csv}
|
|
|
|
ArtID,Desc,Amount,PriceBrut,PriceNett,Tax
|
|
|
|
1,T-Shirt,1,-1,15,19
|
|
|
|
2,Hackerpass,1,-1,5,19
|
|
|
|
3,c3d2-Pin,1,-1,3,19
|
|
|
|
4,Vortragsstunde,2,-1,60,0
|
|
|
|
\end{filecontents*}
|
2016-11-19 14:43:31 +01:00
|
|
|
|
2016-12-09 11:01:34 +01:00
|
|
|
\newcommand{\Tax}{19}
|
2016-11-19 12:16:47 +01:00
|
|
|
|
|
|
|
\begin{document}
|
|
|
|
|
2016-12-09 11:01:34 +01:00
|
|
|
\par \textbf{SpreadTab}
|
|
|
|
|
|
|
|
\begin{spreadtab}{{tabularx}{\textwidth}{|l|X|l|l|l|r|r|}}
|
|
|
|
\hline
|
|
|
|
:={}Artikelnr. &
|
|
|
|
:={}Bezeichnung &
|
|
|
|
:={}Anzahl &
|
|
|
|
:={}Steuersatz &
|
|
|
|
:={}Netto &
|
|
|
|
:={}Brutto &
|
|
|
|
:={}Gesamt \\
|
|
|
|
\hline\hline
|
|
|
|
:={}1337 &
|
|
|
|
:={}Bla &
|
|
|
|
1 &
|
|
|
|
:={19} &
|
|
|
|
\EUR{:={[1,0]/(100+[-1,0])*100}} &
|
|
|
|
\EUR{:={10}} &
|
|
|
|
\EUR{:={[-1,0]*[-4,0]}} \\
|
|
|
|
\hline
|
|
|
|
:={}\multicolumn{6}{|r|}{Gesamtsumme:} &
|
|
|
|
\EUR{:={sum(g2:[0,-1])}} \\
|
|
|
|
\hline
|
|
|
|
:={}\multicolumn{5}{|r|}{Enthaltene Umsatzsteuer:} &
|
|
|
|
:={\Tax}\% &
|
|
|
|
\EUR{:={[-1,0]/100*[0,-1]}} \\
|
|
|
|
\hline
|
|
|
|
:={}\multicolumn{6}{|r|}{\textbf{Rechungsbetrag:}} &
|
|
|
|
\EUR{:={[0,-2]+[0,-1]tag(RB)}} \\
|
|
|
|
\hline
|
|
|
|
\end{spreadtab}
|
2016-11-19 12:16:47 +01:00
|
|
|
|
2016-12-09 11:01:34 +01:00
|
|
|
\par \textbf{CSVReader}
|
2016-11-19 12:16:47 +01:00
|
|
|
|
2016-12-09 11:01:34 +01:00
|
|
|
\csvreader[
|
|
|
|
tabular=|r|l|r|r|r|r|r|r|,
|
|
|
|
table head=\hline \textbf{\#} & \textbf{Artikel} & \textbf{Anzahl} & \textbf{USt} & \textbf{Netto} & \textbf{Brutto} & \textbf{berechnet!} \\ \hline\hline,
|
|
|
|
late after line={\\\hline}
|
|
|
|
]{data.csv}{
|
|
|
|
ArtID=\nr,
|
|
|
|
Desc=\name,
|
|
|
|
Amount=\anz,
|
|
|
|
Tax=\st,
|
|
|
|
PriceNett=\ne,
|
|
|
|
PriceBrut=\br
|
|
|
|
}{
|
|
|
|
\nr &
|
|
|
|
\name &
|
|
|
|
\anz &
|
|
|
|
\st\,\% &
|
|
|
|
\br &
|
|
|
|
\ne &
|
|
|
|
:={[-1,0]/100*[0,-1]}
|
|
|
|
}
|
2016-11-19 12:16:47 +01:00
|
|
|
|
2016-11-19 14:43:31 +01:00
|
|
|
|
2016-12-09 11:01:34 +01:00
|
|
|
\par \textbf{!Integration || Transition}
|
2016-11-19 14:43:31 +01:00
|
|
|
|
2016-12-09 11:01:34 +01:00
|
|
|
\FPeval\summe{0}
|
|
|
|
\csvreader[
|
|
|
|
tabular=|r|l|r|r|r|r|r|r|,
|
|
|
|
table head=\hline \textbf{\#} & \textbf{Artikel} & \textbf{Anzahl} &
|
|
|
|
\textbf{USt} & \textbf{Netto} & \textbf{Brutto} & \textbf{berechnet!} \\
|
|
|
|
\hline\hline,
|
|
|
|
late after line={\\\hline},
|
|
|
|
table foot=\multicolumn{7}{|r|}{Summe: \FPeval\result{round(summe:2)}\EUR{\result}}\\\hline
|
|
|
|
]{data.csv}{
|
|
|
|
ArtID=\nr,
|
|
|
|
Desc=\name,
|
|
|
|
Amount=\anz,
|
|
|
|
Tax=\st,
|
|
|
|
PriceNett=\ne,
|
|
|
|
PriceBrut=\br
|
|
|
|
}{
|
|
|
|
\nr &
|
|
|
|
\name &
|
|
|
|
\anz &
|
|
|
|
\st\,\% &
|
|
|
|
%\br
|
|
|
|
\FPeval\result{round(ne/(1+st/100):2)}\EUR{\result}
|
|
|
|
&
|
|
|
|
% \ne
|
|
|
|
\FPeval\result{round(ne:2)}\EUR{\result}
|
|
|
|
&
|
|
|
|
% :={[-1,0]/100*[0,-1]}
|
|
|
|
\FPeval\result{round(ne*anz:2)}\EUR{\result}%
|
|
|
|
\FPeval\summe{summe+result}\xdef\summe{\summe}%
|
|
|
|
}
|
2016-11-19 12:16:47 +01:00
|
|
|
|
|
|
|
\end{document}
|