Implement option to add account2s and commodities to resolve #2.

This commit is contained in:
2023-10-17 13:45:20 +02:00
parent c96752e599
commit e29d08e0d7
6 changed files with 20 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
from pathlib import Path
from typing import List
from src.models import Transaction
from src.models import Transaction, Config
LEDGER_TRANSACTION_TEMPLATE = """
@@ -10,8 +10,8 @@ LEDGER_TRANSACTION_TEMPLATE = """
"""
def render_to_file(transactions: List[Transaction], ledger_file: Path):
def render_to_file(transactions: List[Transaction], config: Config):
content = "".join([LEDGER_TRANSACTION_TEMPLATE.format(t=t)
for t in transactions])
with open(ledger_file, 'a') as f:
with open(config.output_file, 'a') as f:
f.write(content)