bankstatement.cls 0.9.2 A L A T E X class for bank statements based on csv data 2015/11/14 Package author: Josef Kleber



Similar documents
The tikzposter class

Magento module Documentation

A couple of things involving environments

A package for rotated objects in L A TEX

The gensymb package for L A TEX 2ε

chemscheme Support for chemical schemes

LATEX curricula vitae with the CurVe class

Microsoft Excel Training - Course Topic Selections

Installation and Operation Manual Portable Device Manager, Windows version

May 20, MyCV * Author: Andrea Ghersi. Abstract

BRAZOSPORT COLLEGE Syllabus BCIS 1405 Business Computer Applications On-Line Classes

Survey Designer USER MANUAL. Version 1.2

Creating Codes with Spreadsheet Upload

The tikzposter class

Table of Contents. Getting Started...1. Chart of Accounts...1. Sales Tax...3. Setting Up Sales Tax the big picture... 3

Salary Review Spreadsheets

Call Management Detail Call Report

Check out our website!

COGNOS 8 Business Intelligence

Drawing a histogram using Excel

256 TUGboat, Volume 35 (2014), No. 3

User Guide. Trade Finance Global. Reports Centre. October nordea.com/cm OR tradefinance Name of document 8/8 2015/V1

Work with the MiniBase App

DOCMAIL: ADVANCED USER GUIDE. Version 2.4 February 2016

Novell ZENworks Asset Management 7.5

Dissertation Template for Princeton. University

SIF Validation Tool. Wages Protection System Qatar Central Bank& Ministry of Labour And Social Affairs. End User Guide

Access II 2007 Workshop

Wellesley College Alumnae Association. Volunteer Instructions for Template

Basic Microsoft Excel 2007

Section 1 Spreadsheet Design

SelectSurvey.NET User Manual

Hypercosm. Studio.

Table Of Contents. iii

Training Needs Analysis

ASSESSMENT GENERATOR TUTORIAL CREATING ASSESSMENTS SIMPLE TYPE ASSESSMENT

CONTENTM WEBSITE MANAGEMENT SYSTEM. Getting Started Guide

Rochester Institute of Technology. Oracle Training: Advanced Financial Application Training

Google Apps for Sharing Folders and Collecting Assignments

DIGITAL DESIGN APPLICATIONS Word Exam REVIEW

ECDL / ICDL Spreadsheets Syllabus Version 5.0

NN Avaya Aura Contact Center Performance Management

CNC Transfer. Operating Manual

Creating Online Surveys with Qualtrics Survey Tool

Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide

IRA Pivot Table Review and Using Analyze to Modify Reports. For help,

ez Service Portal User Guide version 2.5.1

Fairsail PDF Template Generator: A Complete Guide

BCS IT User Syllabus Version 2.0 Sample Test Word Processing Level 1 Version SampleMQTB/2.0/WP1/v1.0_XP07 SAMPLE TEST

PERFORMING REGRESSION ANALYSIS USING MICROSOFT EXCEL

CREATING EXCEL PIVOT TABLES AND PIVOT CHARTS FOR LIBRARY QUESTIONNAIRE RESULTS

Sitecore InDesign Connector 1.1

Search help. More on Office.com: images templates. Here are some basic tasks that you can do in Microsoft Excel 2010.

Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences. Mike Dempsey

Note: With v3.2, the DocuSign Fetch application was renamed DocuSign Retrieve.

Dashboard Builder TM for Microsoft Access

Inventory Web Pro Version User Guide

Using an Access Database

ICP Data Validation and Aggregation Module Training document. HHC Data Validation and Aggregation Module Training Document

Excel Intermediate Session 2: Charts and Tables

X10 Webinterface User Quick Guide(ver0.9.2 Beta)

Basic Excel Handbook

Chapter 26 EasyPrinter

Creating a Newsletter with Microsoft Word

NETWORK PRINT MONITOR User Guide

Catalog Creator by On-site Custom Software

Using your Drupal Website Book 1 - Drupal Basics

AT&T UC - CPRT. Customer Provisioning Reporting Tool. April CPRT Version: 1.33

How to Use Swiftpage for SageCRM

Technical Report. The KNIME Text Processing Feature:

Word 2007: Basics Learning Guide

How to Use Swiftpage for Microsoft Excel

Microsoft Access Introduction

Visualization with Excel Tools and Microsoft Azure

APC Application Suite. Installation and Setup Guide Version 4.01

Teacher Activities Page Directions

How to Use a Data Spreadsheet: Excel

A package for making sticky labels in L A TEX

3 What s New in Excel 2007

STC: Descriptive Statistics in Excel Running Descriptive and Correlational Analysis in Excel 2013

Enhanced Formatting and Document Management. Word Unit 3 Module 3. Diocese of St. Petersburg Office of Training Training@dosp.

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

Removed from product. > Removed from product. > Removed from product. Navigation Buttons Filter Toggle > Removed from product

MICROSOFT OFFICE ACCESS NEW FEATURES

Blackbaud StudentInformationSystem. Reports Guide for Admissions Office

Excel 2007 Tutorials - Video File Attributes

Cashion High School Fundamentals of Administrative Technologies Syllabus Course Number: 8103 (OK Promise Approved)

SAPScript. A Standard Text is a like our normal documents. In Standard Text, you can create standard documents like letters, articles etc

Use the Microsoft Office Word Add-In to Create a Source Document Template for Microsoft Dynamics AX 2012 WHITEPAPER

How To Use L A Tex In Linux (Programming) With A Class File And Package File (Programmer) (Programmers) (For A Test Drive) (Permanent) (Powerpoint)

LaGuardia Community College Thomson Ave, Long Island City, New York Created by ISMD s Dept. Training Team. Overview

Keeper Care System Data Manager Version 1.2.6

Strategic Asset Tracking System User Guide

Various chapter styles for the memoir class

Transcription:

0.9.2 A L A T E X class for bank statements based on csv data 2015/11/14 Package author: Josef Kleber bankstatement@jklatex.de http://bankstatement.jklatex.de/

Contents 1 Class options 4 2 The bankstatement command 4 3 Customization 5 3.1 Languages................................ 5 3.2 Formats................................. 5 4 Example 5 5 Implementation 6 6 References 10 7 Change History 11 8 Index 12 2

Abstract Abstract More and more banks allow their customers to download posting records in various formats. By using the bankstatement class, you can create bank statements as long as a csv format is available! At the moment, the csv-mt940 and csv-camt formats used by many german Sparkassen are supported. Moreover, it supports csv-standard-bank-na! Furthermore, the following languages are supported: english, german, namibian You can quite easily add support for other languages or csv formats. Simply define the order of the keys in the csv data file and how to use them. The terminology in this class like BIC (Business Identifier Codes) or IBAN (International Bank Account Number) is based on SEPA (Single Euro Payments Area). But you can adjust the terminology to suit your needs. 3

Contents 1 Class options format (csv-mt940) specifies the csv format of your data files language (english) specifies the language of your document left (2cm) specifies the left margin right (2cm) specifies the right margin top (2cm) specifies the top margin bottom (2cm) specifies the bottom margin 2 The bankstatement command \bankstatement [ options ]{{ csv file }} The \bankstatement command reads in { csv file } and outputs your bank statement. It supports the following options, which can also be used as class options with global scope: title () specifies the title of your bank statement logo () specifies the logo used in the bank statement. It may be the logo of your bank or the sports club, whose treasurer you are. logowidth (4cm) defines the width of the logo holder () specifies the account holder bic () specisfies the BIC (Business Identifier Codes) iban () specifies the IBAN (International Bank Account Number) referencewidth (11cm) specifies the width of the second table column used for the reference. Depending on page size, margins and font you may need to adjust the width. negativecolor (red) specifies the color used for negative amounts sort (PostingDate) defines the sort key of the csv data base openingbalance (none) specifies the opening balance. csv posting records do not contain an opening balance, only postings. closingbalance (none) specifies the closing balance Make sure to use the same encoding in your document than in the csv file(s)! 4

3 Customization 3 Customization You can quite easily add support for other languages [2] and formats [1]. Please send a copy to the maintainer of bankstatement. 3.1 Languages Supported languages: english german namibian To support other languages, simply copy stmenglish.def to your local T E X tree, rename it and translate the definitions to your language! [2] 3.2 Formats Supported formats: csv-mt940 csv-camt csv-standard-bank-na To support other formats [1], simply copy csv-mt940.def to your local T E X tree, rename it and adjust the definitions to your needs! That is, define the order of keys in your format and specify how to use them. Furthermore, you should specify the separator of the csv file and whether the csv file has a header row or not. 4 Example 1 \documentclass[a4paper,10pt,bic=byladem1erd, 2 iban=de70753574230240408336, 3 holder={josef Kleber}, 4 language=german,logo=stmlogo, 5 format=csv-camt, 6 logowidth=4cm,negativecolor=red] 7 {bankstatement} 8 \usepackage[german]{babel} 5

5 Implementation 9 \usepackage[utf8]{inputenc} 10 \usepackage[t1]{fontenc} 11 \usepackage{textcomp} 12 \usepackage{bera} 13 \renewcommand\familydefault{\sfdefault} 14 \begin{document} 15 \bankstatement[title={kontoauszug 12/2014}, 16 openingbalance={-12,34}, 17 closingbalance={82,13}]{201412.csv} 18 \end{document} 5 Implementation 1 *class First, we provide the L A T E X class bankstatement. 2 \NeedsTeXFormat{LaTeX2e}% 3 \ProvidesClass{bankstatement}[2015/11/14 class for csv based bank statements v0.9.2]% We need the xkeyval package and the xkvlxp package to allow curly braces and a bit more in global class options! 4 \RequirePackage{xkeyval}% 5 \RequirePackage{xkvltxp}% We provide a macro \STM@JK@define@key, which defines class options with global scope and options for \bankstatement with local scope. It takes four arguments { prefix }, { package },{ option } and { default }. 6 \newcommand*\stm@jk@define@key[4]% 7 {% 8 \expandafter\gdef\csname#1@#3\endcsname{#4}% 9 \define@key{#2.cls}{#3}[#4]% 10 {% 11 \expandafter\gdef\csname#1@#3\endcsname{##1}% 12 }% 13 \define@key{#2}{#3}% 14 {% 15 \expandafter\def\csname#1@#3\endcsname{##1}% 16 }% 17 }% Now, we can use this macro to define our options. 18 \STM@JK@define@key{STM@JK}{bankstatement}{format}{csv-mt940}% 19 \STM@JK@define@key{STM@JK}{bankstatement}{language}{english}% 20 \STM@JK@define@key{STM@JK}{bankstatement}{title}{}% 21 \STM@JK@define@key{STM@JK}{bankstatement}{logo}{}% 22 \STM@JK@define@key{STM@JK}{bankstatement}{logowidth}{4cm}% 6

5 Implementation 23 \STM@JK@define@key{STM@JK}{bankstatement}{holder}{}% 24 \STM@JK@define@key{STM@JK}{bankstatement}{bic}{}% 25 \STM@JK@define@key{STM@JK}{bankstatement}{iban}{}% 26 \STM@JK@define@key{STM@JK}{bankstatement}{referencewidth}{11cm}% 27 \STM@JK@define@key{STM@JK}{bankstatement}{negativecolor}{red}% 28 \STM@JK@define@key{STM@JK}{bankstatement}{sort}{PostingDate}% 29 \STM@JK@define@key{STM@JK}{bankstatement}{openingbalance}{none}% 30 \STM@JK@define@key{STM@JK}{bankstatement}{closingbalance}{none}% 31 \STM@JK@define@key{STM@JK}{bankstatement}{left}{2cm}% 32 \STM@JK@define@key{STM@JK}{bankstatement}{right}{2cm}% 33 \STM@JK@define@key{STM@JK}{bankstatement}{top}{2cm}% 34 \STM@JK@define@key{STM@JK}{bankstatement}{bottom}{2cm}% We execute the class options to define and set the option macros. 35 \DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{article}}% 36 \ExecuteOptionsX{format,language,title,logo,logowidth,holder,bic,iban,% 37 referencewidth,negativecolor,sort,openingbalance,% 38 closingbalance,left,right,top,bottom}% 39 \ProcessOptionsX*\relax% 40 \LoadClass{article}% We load some more needed packages. 41 \RequirePackage[left=\STM@JK@left,right=\STM@JK@right,top=\STM@JK@top,% 42 bottom=\stm@jk@bottom]{geometry}% 43 \RequirePackage{longtable}% 44 \RequirePackage{tabularx}% 45 \RequirePackage{xcolor}% 46 \RequirePackage{graphicx}% 47 \RequirePackage{booktabs}% 48 \RequirePackage{datatool}% 49 \RequirePackage{calc}% 50 \RequirePackage{ifthen}% 51 \RequirePackage{siunitx}% We define some macros, which will be redefined in language and format definition files! 52 \newcommand*\stm@jk@dbkeys{}% 53 \newcommand*\stm@jk@dtlforeach{}% 54 \newcommand*\stm@jk@holdername{}% 55 \newcommand*\stm@jk@bicname{}% 56 \newcommand*\stm@jk@ibanname{}% 57 \newcommand*\stm@jk@firstcolumnheading{}% 58 \newcommand*\stm@jk@secondcolumnheading{}% 59 \newcommand*\stm@jk@thirdcolumnheading{}% 60 \newcommand*\stm@jk@openingbalancename{}% 61 \newcommand*\stm@jk@closingbalancename{}% We set some defaults and create a counter for unique data base names. 62 \newcommand*\stm@jk@headingsep{0.5cm}% 63 \newcommand*\stm@jk@noheader{false}% 7

5 Implementation 64 % 65 \newcounter{stm@jk@count}% We load the language and format definition files specified as class options. 66 \input{\stm@jk@format.def}% 67 \input{stm\stm@jk@language.def}% This macro typesets a given logo at the right border. 68 \newcommand*\stm@jk@includelogo% 69 {% 70 \ifthenelse{\equal{\stm@jk@logo}{}}% 71 {}% 72 {\hfill\includegraphics[width=\stm@jk@logowidth]{\stm@jk@logo}}% 73 }% This macro typesets the header of the bank statement. 74 \newcommand*\stm@jk@header% 75 {% 76 \noindent% 77 \begin{tabularx}{\textwidth}{xxr}% 78 \multicolumn{3}{l}{\huge{}\hspace{.22em}\stm@jk@title\stm@jk@includelogo}\\% 79 & &\\% 80 \begin{tabular}{l}\textbf{\stm@jk@holdername}\\\stm@jk@holder\end{tabular} &% 81 \begin{tabular}{l}\textbf{\stm@jk@bicname}\\\stm@jk@bic\end{tabular} &% 82 \begin{tabular}{l}\textbf{\stm@jk@ibanname}\\\stm@jk@iban\end{tabular}\\% 83 \end{tabularx}% 84 \vspace{\stm@jk@headingsep}% 85 }% \bankstatement Here, we define the user command to typeset the bank statement. \bankstatement[ options ]{ csv file } 86 \newcommand\bankstatement[2][]% 87 {% We start a group to keep the setting of options local. Then we step our unique counter and define a macro for the current data base name for multi command usage! 88 \begingroup% 89 \setkeys{bankstatement}{#1}% 90 \stepcounter{stm@jk@count}% 91 \xdef\stm@jk@dbname{stm\arabic{stm@jk@count}}% Then we can load { csv file } into our data base depending on the noheader option! Finally, we sort our data base depending on the data base key specified with the sort option! 92 \ifthenelse{\equal{\stm@jk@noheader}{false}}% 93 {\DTLloadrawdb[keys={\STM@JK@dbkeys},noheader=false]{\STM@JK@dbname}{#2}}% 94 {\DTLloadrawdb[keys={\STM@JK@dbkeys},noheader=true]{\STM@JK@dbname}{#2}}% 8

5 Implementation 95 \ifthenelse{\equal{\stm@jk@sort}{}}% 96 {}% 97 {\DTLsort{\STM@JK@sort}{\STM@JK@dbname}}% Now we can typeset the header of the bank statement and start the longtable. Maybe, we still need to typeset an opening balance. 98 \STM@JK@header% 99 \begin{longtable}{llr}% 100 \toprule% 101 \STM@JK@firstcolumnheading &% 102 \STM@JK@secondcolumnheading &% 103 \STM@JK@thirdcolumnheading% 104 \\\toprule% 105 \endhead% 106 \ifthenelse{\equal{\stm@jk@openingbalance}{none}}% 107 {}% 108 { & & \\ & \STM@JK@openingbalancename &% 109 \DTLifStartsWith{\STM@JK@openingbalance}{-}% 110 {\textcolor{\stm@jk@negativecolor}{\num{\stm@jk@openingbalance}}}% 111 {\num{\stm@jk@openingbalance}} \\\midrule}% Now, we can loop through our database and create a new row for each line in { csv file }. Finally, we can end the longtable. 112 \STM@JK@DTLforeach% 113 \end{longtable}% 114 \endgroup% 115 }% Finally, we disable the global class options \AtBeginDocument. 116 \AtBeginDocument{\disable@keys{bankstatement}% 117 {format,language,left,right,top,bottom}}% 118 /class 9

6 References 6 References [1] Josef Kleber. HowTo support arbitrary CSV formats, 2015. http://bankstatement.jklatex.de/en/2015/11/howto-support-arbitrary-csvformats-2/. [2] Josef Kleber. HowTo support other languages, 2015. http://bankstatement.jklatex.de/en/2015/11/howto-support-otherlanguages/. [3] Nicola L.C. Talbot. User Manual for datatool bundle version 2.22, 2014. http://mirrors.ctan.org/macros/latex/contrib/datatool/datatool-user.pdf. [4] wikipedia.org. International Bank Account Number, 2014. https://en.wikipedia.org/wiki/international_bank_account_number. [5] wikipedia.org. ISO 9362, 2014. https://en.wikipedia.org/wiki/iso_9362. [6] wikipedia.org. Single Euro Payments Area, 2014. https://en.wikipedia.org/wiki/single_euro_payments_area. [7] Joseph Wright. siunitx A comprehensive (SI) units package, 2014. http://mirrors.ctan.org/macros/latex/contrib/siunitx/siunitx.pdf. 10

7 Change History 7 Change History v0.9.1 General: CTAN upload.......... 6 v0.9.2 General: added csv-standard-bankna.def..................... 6 added siunitx package to force output of exactly two digital places..................... 7 added stmnamibian.def....... 6 updated stmenglish.def....... 6 \bankstatement: catch empty sort key no sorting........... 8 changed \DTLloaddb \DTLloadrawdb............. 8 11

Index A \arabic................... 91 \AtBeginDocument........ 116 B bankstatement (Package)..... 6 \bankstatement........... 86 C \CurrentOption........... 35 D \DeclareOptionX.......... 35 \define@key............ 9, 13 \disable@keys........... 116 \DTLifStartsWith........ 109 \DTLloadrawdb......... 93, 94 \DTLsort.................. 97 E \endhead................ 105 H \hfill................... 72 \hspace.................. 78 \Huge.................... 78 I \includegraphics......... 72 \input................ 66, 67 L \LoadClass............... 40 longtable (Package)......... 9 M \midrule................ 111 \multicolumn............. 78 N \newcounter.............. 65 \noindent................ 76 \num................ 110, 111 P Package bankstatement.......... 6 longtable.............. 9 xkeyval................ 6 xkvlxp................. 6 \PassOptionsToClass...... 35 \ProvidesClass............. 3 S \setkeys................. 89 \stepcounter............. 90 \STM@JK@bic............... 81 \STM@JK@bicname....... 55, 81 \STM@JK@bottom........... 42 \STM@JK@closingbalancename 61 \STM@JK@dbkeys..... 52, 93, 94 \STM@JK@dbname.. 91, 93, 94, 97 \STM@JK@define@key 6, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 \STM@JK@DTLforeach... 53, 112 \STM@JK@firstcolumnheading 57, 101 \STM@JK@format........... 66 \STM@JK@header........ 74, 98 \STM@JK@headingsep.... 62, 84 \STM@JK@holder........... 80 \STM@JK@holdername.... 54, 80 \STM@JK@iban............. 82 \STM@JK@ibanname...... 56, 82 \STM@JK@includelogo... 68, 78 \STM@JK@language.......... 67 \STM@JK@left.............. 41 \STM@JK@logo.......... 70, 72 \STM@JK@logowidth........ 72 \STM@JK@negativecolor... 110 \STM@JK@noheader...... 63, 92 \STM@JK@openingbalance.. 106, 109, 110, 111 \STM@JK@openingbalancename 60, 108 \STM@JK@right............. 41 \STM@JK@secondcolumnheading........ 58, 102 \STM@JK@sort.......... 95, 97 \STM@JK@thirdcolumnheading 59, 103 \STM@JK@title............ 78 \STM@JK@top............... 41 T \textbf............ 80, 81, 82 \textcolor.............. 110 12

Index \textwidth................ 77 \toprule............ 100, 104 V \vspace................... 84 X \xdef..................... 91 xkeyval (Package)........... 6 xkvlxp (Package)............ 6 13