Tuesday 28 October 2008

DTAUS with C#

I needed to export Lastschriften (instructions for direct debit) for our german office, and after looking for some solutions, I realised that it is not that hard to write it yourself...

Here is the result: http://download.pokorra.de/coding/Dtaus.cs
Please feel free to use the code any way you like.
I read the input data from an XML file, of course this needs to be modified to your specific situation.

A good help was this documentation of the german DTAUS bank file format:
http://www.infodrom.org/projects/dtaus/dtaus.html

Another useful tool was the JDTAUS editor, a java editor that can process and create DTAUS files:
http://www.jdtaus.de/de/
I use this to validate and test the files written with my C# program.

8 comments:

Unknown said...

Hi,

I saw in your posted Dtaus.cs file that you use for testing Result78469.tmp as input XML. Would it be a problem if you make that public, also ? Or maybe another example to see how the XML is structured ?

Thanx,
Emil

Timotheus Pokorra said...

Hello Emil,
the xml file is quite simple. I guess you will have your data in some sort of your own format.

I will also upload a fix that is needed because my original version did not cope well with very long references.

Timo

sample xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<EPDirectDebit CurrencyCode = "EUR" ExecutiveName = "Our Organisation" DateEffectiveDay = "31" ExecutiveBankBIC = "" DateEffectiveYear = "2009" DateEffectiveMonth = "1" PaymentDLLNamespace = "Ict.Plugin.EP.Germany" ExecutiveBankSortcode = "12312312" ExecutiveBankingDetails = "8923" ExecutiveBankAccountIBAN = "" ExecutiveBankAccountNumber = "123123">
<Transaction Amount = "8000" PartnerName = "LASTNAME, FIRSTNAME" PartnerBankBIC = "" PartnerSurname = "****" AmountDecimalPlaces = "2" PartnerBankSortcode = "****" PartnerKeyReference = "****" PartnerBankingDetails = "****" PartnerBankAccountIBAN = "" PartnerBankAccountNumber = "****">
<Reference>
some reference
</Reference>
</Transaction>
<Transaction Amount = "4000" PartnerName = "LASTNAME, FIRSTNAME" PartnerBankBIC = "" PartnerSurname = "****" AmountDecimalPlaces = "2" PartnerBankSortcode = "****" PartnerKeyReference = "****" PartnerBankingDetails = "****" PartnerBankAccountIBAN = "" PartnerBankAccountNumber = "****">
<Reference>
some reference
</Reference>
</Transaction>
</EPDirectDebit>

Timotheus Pokorra said...

I have now implemented a parser for SWIFT/MT940 text files as well in C#.
Those files are used for fetching bank statements for a bank account.

I have used the description of the file format from https://www.frankfurter-sparkasse.de/data/50050201/portal/IPSTANDARD/1/content/resources/d09a368d.pdf

You can find the code here:
http://openpetraorg.git.sourceforge.net/git/gitweb.cgi?p=openpetraorg;a=blob;f=csharp/ICT/experimenting/parseMT940/ParseMT940.cs;h=b3e8f283909cefa61b52c1bd1486fc2aa5e2ba5c;hb=e9da0770adcb0c103fada86a425e051cf7831e34

Timotheus Pokorra said...

Here are the shorter URLs for my previous comment regarding SWIFT/MT940:

PDF File with format documentation:
http://tinyurl.com/ne36sx

source code of Parse
MT940.cs: http://tinyurl.com/m3gbrr

geekscout said...

Hi Timotheus,

your file just saved me some hours of hard work, I suppose...
I extended and optimised your code and provided the new version in my Blog, maybe you can use the extended version...

TariqSheikh said...

I not find soure of ur M940 paser on sourec forge

Timotheus Pokorra said...

You are right, sourceforge have changed their links.

Here is the working link:
MT940 code

Jorge said...

Thanks a lot, your code was easy to use and save me lots of hours