c3d2-web/draft/latex/netzbiotop-rechnung.tex

121 lines
2.7 KiB
TeX
Raw Permalink Normal View History

\documentclass{scrlttr2}
2016-11-19 12:16:47 +01:00
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[right]{eurosym}
\usepackage{tabularx,booktabs}
\usepackage{spreadtab}
\usepackage{filecontents}
2016-11-19 20:30:10 +01:00
\STautoround*{2}
\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*}
\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
\newcommand{\Tax}{19}
2016-11-19 12:16:47 +01:00
\begin{document}
\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
\par \textbf{CSVReader}
2016-11-19 12:16:47 +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
\par \textbf{!Integration || Transition}
2016-11-19 14:43:31 +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}