From 8516134687e83c69c2985d4f1e6c301d5798de4c 2019-11-11 15:18:21 From: Brett Smith Date: 2019-11-11 15:18:21 Subject: [PATCH] hooks.ledger_entry: Improve date handling. Check that we have the date field used in the payee line, and not just 'date'. Allow other date fields to be None since they may not be used by the template. --- diff --git a/import2ledger/hooks/ledger_entry.py b/import2ledger/hooks/ledger_entry.py index c47009839601b5c555e290360a5d90eb56c9e4ec..a677dcf30a9df45493513b7944e720521ac40948 100644 --- a/import2ledger/hooks/ledger_entry.py +++ b/import2ledger/hooks/ledger_entry.py @@ -224,7 +224,7 @@ class AccountSplitter: class Template: ACCOUNT_SPLIT_RE = re.compile(r'(?:\t| )\s*') DATE_FMT = '%Y/%m/%d' - PAYEE_LINE_RE = re.compile(r'\{(\w*_)*date\}') + PAYEE_LINE_RE = re.compile(r'^\{(\w*_)*date\}\s') SIGNED_CURRENCY_FMT = '¤#,##0.###;¤-#,##0.###' UNSIGNED_CURRENCY_FMT = '#,##0.### ¤¤' @@ -234,6 +234,7 @@ class Template: unsigned_currency_fmt=UNSIGNED_CURRENCY_FMT, template_name='