Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 3, 15:45 UTC
refactor(statements): use explicit Decimal localcontext import for clarity
davoodmehraban89 committed
Oct 31, 2026 at 00:39 UTC
d6d0fc5da47e7209fe21fe96d48548d1489ef8a7
1 file changed
+2
-2
backend/src/aram_backend/balance_sheet_candidate.py
+2
-2
@@ -8,7 +8,7 @@ An independently authorized finance owner must still approve each policy.
8
from __future__ import annotations
9
10
from dataclasses import asdict, dataclass
11
-from decimal import Decimal
11
+from decimal import Decimal, localcontext
12
from hashlib import sha256
13
import json
14
from typing import Any, Sequence
@@ -170,7 +170,7 @@ def build_balance_sheet_candidate(
170
continue
171
# Display amount uses an explicit sign; never guessed from account codes.
172
exposure = _money(note.candidate_closing_exposure)
173
- with __import__("decimal").localcontext() as context:
173
+ with localcontext() as context:
174
context.prec = 256
175
displayed = exposure * policy.sign_multiplier
176
buckets[policy.category].append(displayed)