Add source info and sort transactions

This commit is contained in:
2025-12-09 21:27:48 -05:00
parent 12408c33f4
commit a190ddc524
6 changed files with 1142 additions and 932 deletions

View File

@@ -8,12 +8,14 @@ BEANCOUNT_TRANSACTION_TEMPLATE = """
{t.date} * {description}{tags}
{account2:<40} {t.debit:<6} {t.currency}
{account1:<40} {t.credit:<6} {t.currency}
source_file: "{t.csv_file}"
source_index: {t.index}
source_row: "{t.row}"
"""
def format(t):
t.date = t.date.replace("/", "-")
tags = ""
description = None
if t.mapping:
@@ -56,3 +58,4 @@ def render_to_file(transactions: List[Transaction], config: Config):
content = "".join(format(t) for t in transactions)
with open(config.output_file, "a") as f:
f.write(content)