Skip to content

Commit

Permalink
[FIX] mis_builder: branche and matrix value computation
Browse files Browse the repository at this point in the history
  • Loading branch information
jguenat committed Nov 8, 2024
1 parent be2d7e5 commit 2494610
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mis_builder/models/aep.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,18 @@ def do_queries(
):
# in initial mode, ignore accounts with 0 balance
continue
self._data[key][acc["account_id"][0]] = (debit * rate, credit * rate)
# due to branches, it's possible to have multiple acc
# with the same account_id
if acc["account_id"][0] in self._data[key]:
existing_debit, existing_credit = self._data[key][
acc["account_id"][0]
]
else:
existing_debit, existing_credit = (0.0, 0.0)
self._data[key][acc["account_id"][0]] = (
existing_debit + debit * rate,
existing_credit + credit * rate,
)
# compute ending balances by summing initial and variation
for key in ends:
domain, mode = key
Expand Down

0 comments on commit 2494610

Please sign in to comment.