diff options
author | Karl Berry <karl@freefriends.org> | 2015-01-07 22:55:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-01-07 22:55:03 +0000 |
commit | e9fbb4ed6dce2e5d9b76bb70d72d9c575da9d5a6 (patch) | |
tree | bd52313d230eb3c72ab28765cc32fea00901a0ff /Master/texmf-dist/tex/latex/bankstatement | |
parent | e94db7b41f3d43082ad3849926c4b1f6dcf730fb (diff) |
bankstatement (7jan15)
git-svn-id: svn://tug.org/texlive/trunk@35985 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bankstatement')
5 files changed, 207 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/bankstatement/bankstatement.cls b/Master/texmf-dist/tex/latex/bankstatement/bankstatement.cls new file mode 100644 index 00000000000..7eba22e1852 --- /dev/null +++ b/Master/texmf-dist/tex/latex/bankstatement/bankstatement.cls @@ -0,0 +1,122 @@ +\NeedsTeXFormat{LaTeX2e}% +\ProvidesClass{bankstatement}[2015/01/07 class for csv based bank statements v0.9.1]% +% +\RequirePackage{xkeyval}% +% needed to allow xxx={yyy} in class options +\RequirePackage{xkvltxp}% +% +\newcommand*\STM@JK@define@key[4]% +{% + \expandafter\gdef\csname#1@#3\endcsname{#4}% + \define@key{#2.cls}{#3}[#4]% + {% + \expandafter\gdef\csname#1@#3\endcsname{##1}% + }% + \define@key{#2}{#3}% + {% + \expandafter\def\csname#1@#3\endcsname{##1}% + }% +}% +% +\STM@JK@define@key{STM@JK}{bankstatement}{format}{csv-mt940}% +\STM@JK@define@key{STM@JK}{bankstatement}{language}{english}% +\STM@JK@define@key{STM@JK}{bankstatement}{title}{}% +\STM@JK@define@key{STM@JK}{bankstatement}{logo}{}% +\STM@JK@define@key{STM@JK}{bankstatement}{logowidth}{4cm}% +\STM@JK@define@key{STM@JK}{bankstatement}{holder}{}% +\STM@JK@define@key{STM@JK}{bankstatement}{bic}{}% +\STM@JK@define@key{STM@JK}{bankstatement}{iban}{}% +\STM@JK@define@key{STM@JK}{bankstatement}{referencewidth}{11cm}% +\STM@JK@define@key{STM@JK}{bankstatement}{negativecolor}{red}% +\STM@JK@define@key{STM@JK}{bankstatement}{sort}{PostingDate}% +\STM@JK@define@key{STM@JK}{bankstatement}{openingbalance}{none}% +\STM@JK@define@key{STM@JK}{bankstatement}{closingbalance}{none}% +\STM@JK@define@key{STM@JK}{bankstatement}{left}{2cm}% +\STM@JK@define@key{STM@JK}{bankstatement}{right}{2cm}% +\STM@JK@define@key{STM@JK}{bankstatement}{top}{2cm}% +\STM@JK@define@key{STM@JK}{bankstatement}{bottom}{2cm}% +% +\DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{article}}% +\ExecuteOptionsX{format,language,title,logo,logowidth,holder,bic,iban,referencewidth,negativecolor,sort,openingbalance,closingbalance,left,right,top,bottom}% +\ProcessOptionsX*\relax% +\LoadClass{article}% +% +\RequirePackage[left=\STM@JK@left,right=\STM@JK@right,top=\STM@JK@top,bottom=\STM@JK@bottom]{geometry}% +\RequirePackage{longtable}% +\RequirePackage{tabularx}% +\RequirePackage{xcolor}% +\RequirePackage{graphicx}% +\RequirePackage{booktabs}% +\RequirePackage{datatool}% +\RequirePackage{calc}% +\RequirePackage{ifthen}% +% +\newcommand*\STM@JK@dbkeys{}% +\newcommand*\STM@JK@DTLforeach{}% +\newcommand*\STM@JK@holdername{}% +\newcommand*\STM@JK@bicname{}% +\newcommand*\STM@JK@ibanname{}% +\newcommand*\STM@JK@firstcolumnheading{}% +\newcommand*\STM@JK@secondcolumnheading{}% +\newcommand*\STM@JK@thirdcolumnheading{}% +\newcommand*\STM@JK@openingbalancenamename{}% +\newcommand*\STM@JK@closingbalancenamename{}% +% +\newcommand*\STM@JK@headingsep{0.5cm}% +\newcommand*\STM@JK@noheader{false}% +% +\newlength\STM@JK@parspace% +\AtBeginDocument{\setlength\STM@JK@parspace{\widthof{(}}}% +\newcounter{STM@JK@count}% +% +\input{\STM@JK@format.def}% +\input{stm\STM@JK@language.def}% +% +\newcommand*\STM@JK@includelogo% +{% + \ifthenelse{\equal{\STM@JK@logo}{}}% + {}% + {\hfill\includegraphics[width=\STM@JK@logowidth]{\STM@JK@logo}}% +}% +% +\newcommand*\STM@JK@header% +{% + \noindent% + \begin{tabularx}{\textwidth}{XXr}% + \multicolumn{3}{l}{\Huge{}\hspace{.22em}\STM@JK@title\STM@JK@includelogo}\\% + & &\\% + \begin{tabular}{l}\textbf{\STM@JK@holdername}\\\STM@JK@holder\end{tabular} &% + \begin{tabular}{l}\textbf{\STM@JK@bicname}\\\STM@JK@bic\end{tabular} &% + \begin{tabular}{l}\textbf{\STM@JK@ibanname}\\\STM@JK@iban\end{tabular}\\% + \end{tabularx}% + \vspace{\STM@JK@headingsep}% +}% +% +\newcommand\bankstatement[2][]% +{% + \begingroup% + \setkeys{bankstatement}{#1}% + \stepcounter{STM@JK@count}% + \xdef\STM@JK@dbname{stm\arabic{STM@JK@count}}% + \ifthenelse{\equal{\STM@JK@noheader}{false}}% + {\DTLloaddb[keys={\STM@JK@dbkeys},noheader=false]{\STM@JK@dbname}{#2}}% + {\DTLloaddb[keys={\STM@JK@dbkeys},noheader=true]{\STM@JK@dbname}{#2}}% + \DTLsort{\STM@JK@sort}{\STM@JK@dbname}% + \STM@JK@header% + \begin{longtable}{llr}% + \toprule% + \STM@JK@firstcolumnheading &% + \STM@JK@secondcolumnheading &% + \STM@JK@thirdcolumnheading% + \\\toprule% + \endhead% + \ifthenelse{\equal{\STM@JK@openingbalance}{none}}% + {}% + { & & \\ & \STM@JK@openingbalancenamename & \DTLifStartsWith{\STM@JK@openingbalance}{-}{\textcolor{\STM@JK@negativecolor}{\STM@JK@openingbalance}}{\STM@JK@openingbalance} \\\midrule}% + \STM@JK@DTLforeach% + \end{longtable}% + \endgroup% +}% +% +\AtBeginDocument{\disable@keys{bankstatement}{format,language,left,right,top,bottom}}% +%
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/bankstatement/csv-camt.def b/Master/texmf-dist/tex/latex/bankstatement/csv-camt.def new file mode 100644 index 00000000000..801569bcf85 --- /dev/null +++ b/Master/texmf-dist/tex/latex/bankstatement/csv-camt.def @@ -0,0 +1,36 @@ +% +% 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,CreditorIdentifier,MandateReference,EndToEndReference,AAA,BBB,CCC,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,\credid=CreditorIdentifier,\mref=MandateReference,\eref=EndToEndReference,\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\\}% + \DTLifstringeq{\credid}{}{}{CRED: \credid\\}% + \DTLifstringeq{\mref}{}{}{MREF: \mref\\}% + \DTLifstringeq{\eref}{}{}{EREF: \eref\\}% + \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}%
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/bankstatement/csv-mt940.def b/Master/texmf-dist/tex/latex/bankstatement/csv-mt940.def new file mode 100644 index 00000000000..ce17e4b6c10 --- /dev/null +++ b/Master/texmf-dist/tex/latex/bankstatement/csv-mt940.def @@ -0,0 +1,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}%
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/bankstatement/stmenglish.def b/Master/texmf-dist/tex/latex/bankstatement/stmenglish.def new file mode 100644 index 00000000000..e24df2c04b8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/bankstatement/stmenglish.def @@ -0,0 +1,8 @@ +\renewcommand*\STM@JK@holdername{Account holder}% +\renewcommand*\STM@JK@bicname{BIC}% +\renewcommand*\STM@JK@ibanname{IBAN}% +\renewcommand*\STM@JK@firstcolumnheading{\bfseries Date}% +\renewcommand*\STM@JK@secondcolumnheading{\bfseries Reference}% +\renewcommand*\STM@JK@thirdcolumnheading{\bfseries Amount (GBP)}% +\renewcommand*\STM@JK@openingbalancenamename{Opening balance}% +\renewcommand*\STM@JK@closingbalancenamename{Closing balance}%
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/bankstatement/stmgerman.def b/Master/texmf-dist/tex/latex/bankstatement/stmgerman.def new file mode 100644 index 00000000000..80129f674cc --- /dev/null +++ b/Master/texmf-dist/tex/latex/bankstatement/stmgerman.def @@ -0,0 +1,8 @@ +\renewcommand*\STM@JK@holdername{Kontoinhaber}% +\renewcommand*\STM@JK@bicname{BIC}% +\renewcommand*\STM@JK@ibanname{IBAN}% +\renewcommand*\STM@JK@firstcolumnheading{\bfseries Datum}% +\renewcommand*\STM@JK@secondcolumnheading{\bfseries Verwendungszweck}% +\renewcommand*\STM@JK@thirdcolumnheading{\bfseries Betrag (EUR)}% +\renewcommand*\STM@JK@openingbalancenamename{Anfangssaldo}% +\renewcommand*\STM@JK@closingbalancenamename{Endsaldo}%
\ No newline at end of file |