Bug(creditcooperatif): Unable to parse date in label 'CB PAYLOGIC 213042': month must be in 1..12
On my bank statement i've notice a bug with a label looking like CB PAYLOGIC 213042
and the following error:
Bug(creditcooperatif): Unable to parse date in label 'CB PAYLOGIC 213042': month must be in 1..12
I've changed a bit the number but the idea is: this is not a date but it's expecting a date after PAYLOGIC
.
After looking deeper into the source code of the caissedepargne module i've noticed that it's used regex to detect some payement. Sadly i'm not an expert into all of that but i'v patched the file with the following modification:
diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py
index 1437d9cad..b80baace7 100644
--- a/modules/caissedepargne/pages.py
+++ b/modules/caissedepargne/pages.py
@@ -425,11 +425,11 @@ class Transaction(FrenchTransaction):
(re.compile(r'^CB [\d\*]+ TOT DIF .*', re.IGNORECASE), FrenchTransaction.TYPE_CARD_SUMMARY),
(re.compile(r'^CB [\d\*]+ (?P<text>.*)', re.IGNORECASE), FrenchTransaction.TYPE_CARD),
(
- re.compile(r'^CB (?P<text>.*?) (?P<dd>\d{2})(?P<mm>\d{2})(?P<yy>\d{2})\b', re.IGNORECASE),
+ re.compile(r'^CB (?P<text>.*?) (?P<dd>0[1-9]|1[0-9]|2[0-9]|3[0-9])(?P<mm>0[1-9]|1[012])(?P<yy>\d{2})', re.IGNORECASE),
FrenchTransaction.TYPE_CARD,
),
(
- re.compile(r'\*CB (?P<text>.*?) (?P<dd>\d{2})(?P<mm>\d{2})(?P<yy>\d{2})\b', re.IGNORECASE),
+ re.compile(r'\*CB (?P<text>.*?) (?P<dd>0[1-9]|1[0-9]|2[0-9]|3[0-9])(?P<mm>0[1-9]|1[012])(?P<yy>\d{2})', re.IGNORECASE),
FrenchTransaction.TYPE_CARD,
),
(
I currently test this code on the master branch directly which i just pull some hours ago. (last commit 58cc2f5b locally)
Do you think I miss some cases? Their could maybe 1 or 2 other regex that could use the same logic and yes it doesn't fit all the case. I've search for the documentation on paylogic on the subject but nothing.