Symptoms
------------
When updating accounts via AqHBCI entries from two or more accounts are merged 
into one account. The remaining accounts receive no updates.

A similar problem was reported on the kmymoney user list 
http://mail.kde.org/pipermail/kmymoney/2011-April/000253.html.

Versions affected
--------------------
4.5.3 and probably others

Description
--------------
in kmymoney/plugins/kbanking/mymoneybanking.cpp stripLeadingZeroes() is used to 
remove leading zeros from bank routing and account numbers. The resulting 
values are used to generate kbanking-acc-ref. In addition to the leading zeroes 
the function incorrectly removes also any digits after significant zeros. This 
can lead to a situation where kbanking-acc-ref's of different accounts are not 
unique, e.g. both stripLeadingZeroes(1205) and stripLeadingZeroes(1204) yield 
12. 

Consequently, when updating such accounts via AqHBCI updates from all accounts 
with the same kbanking-acc-ref are merged into one account.

Testing
---------
The enclosed patch against the 4.5.3 release works for me in my daily usage (in 
fact it makes using kmymoney with my bank accounts with HBCI possible at all) 
but has not been otherwise tested.



Please consider for inclusion.

Thanks for kmymoney. It is a great piece of software!

Best Regards,
Marek
diff -u -r kmymoney-4.5.3/kmymoney/plugins/kbanking/mymoneybanking.cpp kmymoney-4.5.3-patched/kmymoney/plugins/kbanking/mymoneybanking.cpp
--- kmymoney-4.5.3/kmymoney/plugins/kbanking/mymoneybanking.cpp	2011-02-12 10:05:41.000000000 +0100
+++ kmymoney-4.5.3-patched/kmymoney/plugins/kbanking/mymoneybanking.cpp	2011-05-04 14:44:47.142466981 +0200
@@ -343,8 +343,8 @@
 QString KBankingPlugin::stripLeadingZeroes(const QString& s) const
 {
   QString rc(s);
-  QRegExp exp("^(0*)([^0]*)");
-  if (exp.exactMatch(s) != -1) {
+  QRegExp exp("^(0*)([^0].*)");
+  if (exp.indexIn(s) != -1) {
     rc = exp.cap(2);
   }
   return rc;
_______________________________________________
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel

Reply via email to