Skip to content

Commit

Permalink
Parse date_user from card payments
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdkon committed Sep 15, 2023
1 parent 43dd537 commit 3ea3410
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ofxstatement/plugins/mbankcz.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import csv
import re
from datetime import datetime
from typing import Iterable, Optional, List
from decimal import Decimal
Expand Down Expand Up @@ -99,6 +100,14 @@ def parse_record(self, line: List[str]) -> Optional[StatementLine]:
statement_line.date_user, self.date_format
)

date_user_match = re.match(
"^(.*) DATUM PROVEDENÍ TRANSAKCE: (\\d{4}-\\d{2}-\\d{2})$",
line[columns["#Zpráva pro příjemce"]])
if date_user_match:
line[columns["#Zpráva pro příjemce"]] = date_user_match.group(1)
statement_line.date_user = datetime.strptime(
date_user_match.group(2), "%Y-%m-%d")

statement_line.id = statement.generate_transaction_id(statement_line)

# If payee is empty or transactions is percentual saving set payee to -
Expand Down

0 comments on commit 3ea3410

Please sign in to comment.