billing
This commit is contained in:
22
rechnung/billingPreprocessor.py
Normal file
22
rechnung/billingPreprocessor.py
Normal file
@ -0,0 +1,22 @@
|
||||
from decimal import Decimal
|
||||
|
||||
MwSt_TAX_RATE = Decimal(0.19)
|
||||
|
||||
def perform(inputData):
|
||||
inputData['totalBeforeTaxes'] = Decimal(0)
|
||||
for entry in inputData['entries']:
|
||||
entry['totalprice'] = Decimal(entry['count']) * Decimal(entry['unitprice'])
|
||||
inputData['totalBeforeTaxes'] += entry['totalprice']
|
||||
inputData['totalBeforeTaxes'] = inputData['totalBeforeTaxes']
|
||||
inputData['taxes'] = inputData['totalBeforeTaxes'] * MwSt_TAX_RATE
|
||||
inputData['total'] = inputData['totalBeforeTaxes'] + inputData['taxes']
|
||||
|
||||
for entry in inputData['entries']:
|
||||
entry['totalprice'] = f"{entry['totalprice']:.2f}"
|
||||
entry['unitprice'] = f"{entry['unitprice']:.2f}"
|
||||
inputData['totalBeforeTaxes'] = f"{inputData['totalBeforeTaxes']:.2f}"
|
||||
inputData['taxes'] = f"{inputData['taxes']:.2f}"
|
||||
inputData['total'] = f"{inputData['total']:.2f}"
|
||||
|
||||
return inputData
|
||||
|
8
rechnung/rechnung-sample-input.json
Normal file
8
rechnung/rechnung-sample-input.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"billingNo": "2023-1",
|
||||
"receipient": "Herrn Max Mustermann\\\\Dingsstr.\\ 1\\\\12345 Dorf",
|
||||
"salutation": "Hallo Max",
|
||||
"entries": [
|
||||
{ "no": 1, "date": "01.01.2023", "description": "Bla1", "count": 2, "unitprice": 110.0 }
|
||||
]
|
||||
}
|
62
rechnung/rechnung.tmpl
Normal file
62
rechnung/rechnung.tmpl
Normal file
@ -0,0 +1,62 @@
|
||||
\documentclass[12pt]{dinbrief}
|
||||
\usepackage{german}
|
||||
\usepackage{eurosym}
|
||||
\usepackage{longtable}
|
||||
|
||||
|
||||
\address{Ingenieurbüro\\
|
||||
Wolfgang Hottgenroth\\
|
||||
Eupenstr. 20\\
|
||||
45259 Essen}
|
||||
\backaddress{Ingenieurbüro W.\ Hottgenroth, Eupenstr. 20, 45259 Essen}
|
||||
\signature{W.\ Hottgenroth} %% Hier Unterschrift einfuegen
|
||||
\nowindowrules
|
||||
% \yourmail{yourmail}
|
||||
% \sign{sign}
|
||||
\writer{wh} %% Hier eigenen Namen oder Kuerzel einfuegen
|
||||
\phone{0174}{3072474} %% Hier eigene Telefon einfuegen
|
||||
|
||||
\bottomtext{\sffamily\footnotesize wh@ib-hottgenroth.de\\
|
||||
Bankverbindung: IBAN DE96 3505 0105 0001 5037 05, Sparkasse Essen}
|
||||
\begin{document}
|
||||
%% Hier Adresse des Empfaengers einfuegen
|
||||
\begin{letter}{${receipient}}
|
||||
%% Hier Betreff einfuegen
|
||||
\subject{Rechnung Nr. ${billingNo}}
|
||||
%% Hier Anrede einfuegen
|
||||
\opening{${salutation},}
|
||||
|
||||
für Ingenieurdienstleistungen erlaube ich mir entsprechend folgender Spezifikation die Rechnung zu stellen.
|
||||
Ich bitte um Zahlung binnen zwei Wochen an unten angegebene Bankverbindung.
|
||||
|
||||
\begin{longtable}{|p{0.7cm}|p{2.5cm}|p{5.5cm}|p{1cm}|p{2.2cm}|p{2.2cm}|}
|
||||
\hline \bf{Nr.} & \bf{Datum} & \bf{Leistung} & \bf{Anz.} & \bf{Einzel} & \bf{Summe} \\ \hline \hline
|
||||
\endfirsthead
|
||||
\hline \bf{Nr.} & \bf{Datum} & \bf{Leistung} & \bf{Anz.} & \bf{Einzel} & \bf{Summe} \\ \hline \hline
|
||||
\endhead
|
||||
\multicolumn{6}{r}{\em{b.w.}}
|
||||
\endfoot
|
||||
\hline \hline
|
||||
\multicolumn{4}{| p{10cm} |}{Zwischensumme} & & \hfill \tt{${totalBeforeTaxes} \euro{}}\\ \hline
|
||||
\multicolumn{4}{| p{10cm} |}{MwSt.} & \hfill \tt{19 \%} & \hfill \tt{${taxes} \euro{}}\\ \hline
|
||||
\multicolumn{4}{| p{10cm} |}{\bf{Summe}} & & \hfill \tt{${total} \euro{}}\\ \hline
|
||||
\endlastfoot
|
||||
|
||||
#for $entry in $entries
|
||||
\tt{$entry['no']}&
|
||||
\tt{$entry['date']}&
|
||||
\tt{$entry['description']}&
|
||||
\tt{\hfill{}$entry['count']}&
|
||||
\tt{\hfill{}$entry['unitprice'] \euro{}}&
|
||||
\tt{\hfill{}$entry['totalprice'] \euro{}}
|
||||
\\ \hline
|
||||
#end for
|
||||
|
||||
\end{longtable}
|
||||
|
||||
|
||||
|
||||
\closing{Mit freundlichen Gr"u"sen}
|
||||
% \encl{encl}
|
||||
\end{letter}
|
||||
\end{document}
|
Reference in New Issue
Block a user