generated from felixm/defaultpy
Add source info and sort transactions
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user