German title: “Lastschriften in Überweisungen konvertieren”

We have had the situation that a SEPA direct debit was sent twice to the bank.

Now we need to credit our customers the amount again.

I did not find an open source script that reverses a direct debit, but I found https://github.com/AbcAeffchen/Sephpa which can write SEPA direct credit files.

Preparation on CentOS7:

yum install epel-release
yum install php-cli composer
composer require AbcAeffchen/Sephpa

Then get the index.php from below, modify the filename of the direct debit file, and the execution and creation date, and pipe the result:

php reverseSEPA.php > directcredit.xml

Here is the script:

Tags: ,
Posted in Software Development | Comments Closed

With the coming switch in Germany from Bank account number and banking sort code (BLZ) to IBAN and BIC, there are quite some tasks to accomplish.

One task is to convert the bank account numbers to the new IBAN number.
On the first look, you might think that it is simply concatenating the account number and BLZ, add a checksum digit, and you are done. Eg: kto=648489890 and blz=50010517 becomes IBAN DE12500105170648489890
But in fact there are currently 54 rules, explained on 171 pages (see Bundesbank IBAN_Regeln).

There is an Open Source library available under LGPL that does implement all these rules:
http://www.am.hs-mannheim.de/konto_check/

It can be used from several programming languages, among them C# and PHP (see http://kontocheck.sourceforge.net/konto_check.php?fix_nav=1&ausgabe=5&sub=4).
I have packaged it for PHP to offer it as a webservice for OpenPetra.
You can test it live here:
https://kontocheck.solidcharity.com/
I have added an option to use it as a webservice.
Eg. https://kontocheck.solidcharity.com/index.php?kto=648489890&blz=50010517 returns an xml file like this:

1
2
3
4
5
6
7
8
<result>
<bic>INGDDEFFXXX</bic>
<iban>DE12500105170648489890</iban>
<bankname>ING-DiBa</bankname>
<plz>60628</plz>
<ort>Frankfurt am Main</ort>
<kontocheck>ok</kontocheck>
</result>

The packages are built on the Suse Open Build Service: https://build.opensuse.org/package/show/home:tpokorra:kontocheck/kontocheck
At the moment I build it for CentOS5, CentOS6, and Debian 7. If you are interested in other distributions that are available on build.opensuse, let me know, I might add that.

Installation instructions for CentOS5, CentOS6 and Debian 7 see: http://software.opensuse.org/download/package?project=home:tpokorra:kontocheck&package=kontocheck