import bank statements (XML files)

Asked by Bogdan Stanciu

Hello,

I would like to know if there is some addon which could manage the import of Bank Statements into OpenERP. The files come as an archive containing and XML file for data (and many other "garbage" as images and formatting)

For reference, the bank is Swiss PostFinance.

Thank you,
Bogdan

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Pieter J. Kersten (EduSense BV) (pieterj) said :
#1

There is the module account_banking and all its descendants. There is currently no XML filter, but it should be relatively easy to make one. I'm not sure if I understand your definition of 'garbage' though... images in bank statements? Can't picture this.

Revision history for this message
Bogdan Stanciu (bstanciu) said :
#2

Thank you for your quick answer!

Well, I don't know why, but the bank provides the statement in two ways: pdf or "xml". However, the xml is made to look as the pdf, with logos, greetings and all the stuff. therefore, the xml file is not just a data file, the important data is mixed.

here is a sample:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE IC SYSTEM "acc_200.dtd">
<?xml-stylesheet type="text/xsl" href="acc_200.xsl"?><IC xmlns:PF="http://www.post.ch/xml"><IC_HEADER><ICHDR>10-733629-5 Extrait de compte 31.12.2010</ICHDR><ICPFORM>H</ICPFORM><ICVVNR>2.12.0.2</ICVVNR><ICVVTXT>http://www.postfinance.ch/download</ICVVTXT></IC_HEADER><KONAUS><BGM><PF:D_0037>1</PF:D_0037></BGM><DTM><C507><D_2005 Value="202"></D_2005><D_2380 Desc="Date">20101231</D_2380></C507></DTM><DTM><C507><D_2005 Value="194"></D_2005><D_2380 Desc="Extrait de compte">20100201</D_2380></C507></DTM><DTM><C507><D_2005 Value="206"></D_2005><D_2380>20101231</D_2380></C507></DTM><SG2><FII><C078><D_3194 Desc="Numéro de compte">123456789</D_3194><D_3192 Desc="IBAN">CH58 0900 0000 0000 0000 0</D_3192><D_3193 Desc="BIC">POFICHBEXXX</D_3193><D_6345 Value="CHF"></D_6345></C078><PF:D_5388>Compte commercial</PF:D_5388></FII></SG2><SG3><NAD><D_3035 Value="HN"></D_3035><C058><D_3124 Desc="PostFinance Operations Center">Operations Center</D_3124><D_3124>4808 Zofingen</D_3124><D_3124 Desc="Vous êtes conseillé par">team</D_3124></C058></NAD><COM><C076><D_3148 Desc="Téléphone">026 467 27 58</D_3148><D_3155 Value="TE"></D_3155></C076></COM><COM><C076><D_3148 Desc="Fax">058 667 63 66</D_3148><D_3155 Value="FX"></D_3155></C076></COM><COM><C076><D_3148 Desc="Saldophone">0848 221 221 (tarif normal)</D_3148><D_3155 Value="SA"></D_3155></C076></COM><COM><C076><D_3148 Desc="Internet">www.postfinance.ch</D_3148><D_3155 Value="IN"></D_3155></C076></COM></SG3><SG3><NAD><D_3035 Value="HQ"></D_3035><C058><D_3124>Bogdan</D_3124><D_3124>&amp; it</D_3124><D_3124>Lausanne</D_3124></C058></NAD></SG3><SG3><NAD><D_3035 Value="HL"></D_3035><C058><D_3124>Bogdan</D_3124><D_3124>&amp; it</D_3124><D_3124>Avenue de l&apos;Avant</D_3124><D_3124>1005 Lausanne</D_3124></C058></NAD></SG3><PF:FTX><D_4451 Value="AAI"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>PostFinance vous remercie de la confiance témoignée et vous souhaite une</D_4440><D_4440>excellente nouvelle année.</D_4440></C108></PF:FTX><PF:FTX><D_4451 Value="T26"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>Date</D_4440></C108></PF:FTX><PF:FTX><D_4451 Value="T27"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>Texte</D_4440></C108></PF:FTX><PF:FTX><D_4451 Value="T28"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>Crédit</D_4440></C108></PF:FTX><PF:FTX><D_4451 Value="T29"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>Débit</D_4440></C108></PF:FTX><PF:FTX><D_4451 Value="T30"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>Valeur</D_4440></C108></PF:FTX><PF:FTX><D_4451 Value="T31"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>Solde</D_4440></C108></PF:FTX><SG4><LIN><PF:D_0805 Value="LST"></PF:D_0805></LIN><FTX><D_4451 Value="ABN"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>ÉTAT DE COMPTE</D_4440></C108></FTX><SG5><MOA><C516><D_5025 Value="315"></D_5025><D_5004>3000.00</D_5004></C516><PF:D_5003>-</PF:D_5003></MOA><DTM><C507><D_2005 Value="202"></D_2005><D_2380>20100131</D_2380></C507></DTM></SG5></SG4><SG4><LIN><PF:D_0805 Value="LNE"></PF:D_0805></LIN><SG5><MOA><C516><D_5025 Value="15"></D_5025><D_5004>9999.00</D_5004></C516><PF:D_5003>-</PF:D_5003></MOA><DTM><C507><D_2005 Value="202"></D_2005><D_2380>20101231</D_2380></C507></DTM></SG5><SG6><PF:TGT><PF:D_4752 Value="TGT"></PF:D_4752><PF:D_4753>61</PF:D_4753><PF:D_4754>20101231001004010733629000000006</PF:D_4754></PF:TGT><RFF><C506><D_1153 Value="ACD"></D_1153><D_1154>00</D_1154></C506></RFF><DTM><C507><D_2005 Value="209"></D_2005><D_2380>20101231</D_2380></C507></DTM><MOA><C516><D_5025 Value="211"></D_5025><D_5004>2.60</D_5004></C516><PF:D_5003>+</PF:D_5003></MOA><PF:EPC><PF:D_4752 Value="EPC"></PF:D_4752><PF:D_4753>8039</PF:D_4753></PF:EPC><FTX><D_4451 Value="ABN"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>BOUCLEMENT DES INTÉRÊTS 010110 - 311210</D_4440></C108></FTX></SG6></SG4><SG4><LIN><PF:D_0805 Value="LTI"></PF:D_0805></LIN><FTX><D_4451 Value="ABN"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>Total</D_4440></C108></FTX><SG6><MOA><C516><D_5025 Value="210"></D_5025><D_5004>0.00</D_5004></C516><PF:D_5003>+</PF:D_5003></MOA></SG6><SG6><MOA><C516><D_5025 Value="211"></D_5025><D_5004>62.60</D_5004></C516><PF:D_5003>+</PF:D_5003></MOA></SG6></SG4><SG4><LIN><PF:D_0805 Value="LEN"></PF:D_0805></LIN><FTX><D_4451 Value="ABN"></D_4451><D_4453 Value="0"></D_4453><C108><D_4440>ÉTAT DE COMPTE</D_4440></C108></FTX><SG5><MOA><C516><D_5025 Value="343"></D_5025><D_5004>352.60</D_5004></C516><PF:D_5003>-</PF:D_5003></MOA><DTM><C507><D_2005 Value="202"></D_2005><D_2380>20101231</D_2380></C507></DTM></SG5></SG4></KONAUS><IC_TRAILER><ICINFO>Veuillez contrôler l&apos;extrait de compte. Sauf avis contraire de votre part dans les 30 jours à venir, il sera considéré comme accepté.</ICINFO><ICGRUSS>Avec nos meilleures salutations</ICGRUSS><ICGRUSS></ICGRUSS><ICGRUSS>La Poste Suisse</ICGRUSS><ICGRUSS>PostFinance</ICGRUSS></IC_TRAILER></IC>

thank you,
B

Revision history for this message
Pieter J. Kersten (EduSense BV) (pieterj) said :
#3

The XML you provided is clean and contains just textual and numerical data. No images/logo's, whatever. Perhaps your browser has access to some matching XSL sheet and the images it refers to? In that case, it will render the XML as HTML. For import in OpenERP you only need the XML (and of course an explanation of the XML in order to develop a proper parser). AFAICT, it should be no sweat. If you have access to the explanation, that is.

Revision history for this message
Bogdan Stanciu (bstanciu) said :
#4

Thank you again!

Yes, this is just the xml file, as you say. there is a xsl, and images, etc in the dwd. But it was clear that this is the needed file. What do you mean having access to the explanation?

I have two additional questions:
1. which branch of yours should I use to get account_banking?
2. As I have NO experience in this kind of task (but I am ready to give it a try) could you please provide some steps on how to tackle it?
E.g. should I use the account_banking module (or other, or any) and develop an extension? Is there one which is somehow similar?

regards,
Bogdan

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Bogdan Stanciu (bstanciu) said :
#6

For Q1 I have the answer, as you deleted the extra-addons modules ;)
for Q2...

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#7

Hi Bogdan,

the version of the modules in extra-addons/6.0 and trunk were not compatible with the OpenERP versions associated with these branches. I deleted the obsolete version of the modules from these branches. The version of the modules which are compatible with OpenERP 6.0 are now here:

    https://launchpad.net/banking-addons

You need the account_banking module to run your extension module. Examples of such extension modules are:

    account_banking_nl_multibank
    account_banking_nl_abnamro
    account_banking_nl_triodos

These extension modules all process files in CSV format, but they should give you the big picture of the data structures that you need to extract from your XML files.

Cheers,
Stefan.

Revision history for this message
Niels Huylebroeck (red15) said :
#8

Hi Bogdan,

A quick glance at your xml file shows it's actually an EDI file, see for example this piece:

<COM><C076><D_3148 Desc="Téléphone">026 467 27 58</D_3148><D_3155 Value="TE"></D_3155></C076></COM>

Look at the UN/EDIFACT definition it tells me that field 3148 is a Communication address identifier ( http://www.altova.com/edifact_messages/edifact-tred3148.html )

Also you can see in this link they say : "DataElement 3148 is used in the following Batch Composite Elements: C076" this is the parent xml node <C076>

I've been working on something of a generic import module which so far only handles csv imports, but it was built to be extensible and we had plans to work on an EDI module sometime in the future.

You can find the module in Github as we have not yet integrated this module into our "released" branch here on launchpad because we still might need to make major API changes.

https://github.com/Agaplan/agaplan_import

and the csv import module is here
https://github.com/Agaplan/agaplan_import_csv

Regards,
Niels

Can you help with this problem?

Provide an answer of your own, or ask Bogdan Stanciu for more information if necessary.

To post a message you must log in.