From 333493a4625338d4ca83c58e7c3226f82ac46cc3 Mon Sep 17 00:00:00 2001 From: Lucas Ficheux Date: Wed, 11 Sep 2019 14:30:25 +0200 Subject: [PATCH] [bnporc] Type summary_card that weren't typed Some transactions were typed as unknown while their label tells us it is a summary_card. They are type as AUTOP in the json. --- modules/bnporc/enterprise/pages.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/bnporc/enterprise/pages.py b/modules/bnporc/enterprise/pages.py index a9555c5e2b..e24885f78a 100644 --- a/modules/bnporc/enterprise/pages.py +++ b/modules/bnporc/enterprise/pages.py @@ -261,7 +261,10 @@ def obj_raw(self): def obj_type(self): type = self.page.TYPES.get(Dict('nature/codefamille')(self), Transaction.TYPE_UNKNOWN) - if type == Transaction.TYPE_CARD and re.search(r' RELEVE DU \d+\.', Field('raw')(self)): + if ( + (type == Transaction.TYPE_CARD and re.search(r' RELEVE DU \d+\.', Field('raw')(self))) or + (type == Transaction.TYPE_UNKNOWN and re.search(r'FACTURE CARTE AFFAIRES \w{16} SUIVANT RELEVE DU \d{2}.\d{2}.\d{4}', Field('raw')(self))) + ): return Transaction.TYPE_CARD_SUMMARY return type -- GitLab