generated from felixm/defaultpy
Add source info and sort transactions
This commit is contained in:
@@ -70,7 +70,7 @@ def write_mappings(transactions: List[Transaction], mappings_file: Path):
|
||||
|
||||
mappings = read_mappings(mappings_file)
|
||||
for t in transactions:
|
||||
if t.row in mappings:
|
||||
if t.key() in mappings:
|
||||
pass
|
||||
else:
|
||||
mapping = Mapping(
|
||||
@@ -79,7 +79,7 @@ def write_mappings(transactions: List[Transaction], mappings_file: Path):
|
||||
"narration": t.description,
|
||||
}
|
||||
)
|
||||
mappings[t.row] = mapping
|
||||
mappings[t.key()] = mapping
|
||||
|
||||
mappings = {k: v.model_dump(exclude_none=True) for k, v in mappings.items()}
|
||||
with open(mappings_file, "w") as f:
|
||||
|
||||
Reference in New Issue
Block a user