summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bankstatement/csv-mt940.def
blob: ce17e4b6c1077cedbe32e8d8d4b16d4dc3fcf342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
%
% definitions for the csv-mt940 format
%
% define the order of keys in your csv file
% simply use arbitrary keys for unused fields
\renewcommand*\STM@JK@dbkeys{Account,PostingDate,ValueDate,Type,Reference,Recipient,IBAN,BIC,Amount,Currency,Info}%
% define usage of key values inside the used longtable
% dates & mixed information & amount
\renewcommand*\STM@JK@DTLforeach%
{%
  \DTLforeach{\STM@JK@dbname}%
  {\postingdate=PostingDate,\valuedate=ValueDate,\type=Type,\reference=Reference,\recipient=Recipient,\iban=IBAN,\bic=BIC,\amount=Amount,\currency=Currency}%
  {%
    \parbox[t]{\widthof{ DD.MM.YYYY }}{\hspace{\STM@JK@parspace}\postingdate\\(\valuedate)} &%
    \parbox[t]{\STM@JK@referencewidth}{\raggedright%
                                       \DTLifstringeq{\type}{}{}{\type\\}%
                                       \DTLifstringeq{\bic}{}{-}{\bic{}}\DTLifstringeq{\iban}{}{}{ / \iban}\\%
                                       \DTLifstringeq{\recipient}{}{}{\recipient\\}%
                                       \reference} &%
    \DTLifStartsWith{\amount}{-}{\textcolor{\STM@JK@negativecolor}{\amount}}{\amount}%
    \DTLiflastrow{%
                   \ifthenelse{\equal{\STM@JK@closingbalance}{none}}%
                   {}%
                   {\\\midrule\\ & \STM@JK@closingbalancenamename & \DTLifStartsWith{\STM@JK@closingbalance}{-}{\textcolor{\STM@JK@negativecolor}{\STM@JK@closingbalance}}{\STM@JK@closingbalance}}%
                   \\\bottomrule%
                 }%
                 {\\ & & \\}%
  }%
}%
% set separator of csv file
\DTLsetseparator{;}%
% does the csv file (not) have a header row? ;-)
\renewcommand*\STM@JK@noheader{false}%