add CE detailed label as metadata

This commit is contained in:
Antoine Martin 2022-11-10 19:34:47 +01:00
parent 6d6e281b0a
commit 116467ae43

View file

@ -13,6 +13,7 @@ from beancount.ingest import cache, importer # type: ignore
COL_DATE = "Date de comptabilisation"
COL_LABEL = "Libelle simplifie"
COL_DETAILED_LABEL = "Libelle operation"
COL_DEBIT = "Debit"
COL_CREDIT = "Credit"
COL_DETAIL = "Informations complementaires"
@ -80,6 +81,7 @@ class CDEImporter(importer.ImporterProtocol):
category: str = row[COL_CATEGORY]
subcategory: str = row[COL_SUBCATEGORY]
label: str = row[COL_LABEL]
detailed_label: str = row[COL_DETAILED_LABEL]
debit: str = row[COL_DEBIT]
credit: str = row[COL_CREDIT]
detail: str = row[COL_DETAIL] if row[COL_DETAIL] else ""
@ -114,6 +116,7 @@ class CDEImporter(importer.ImporterProtocol):
meta["op_date"] = op_date
meta["ce_category"] = f"{category} - {subcategory}"
meta["detailed_label"] = detailed_label
directives.append(
data.Transaction(