Show credit settlements as positive amounts

This commit is contained in:
Marcel Peterkau
2026-06-27 15:39:52 +02:00
parent d897dd5f6e
commit d8900d9767
5 changed files with 54 additions and 3 deletions
+7
View File
@@ -76,6 +76,13 @@ def allocated_total(data: ContributionData, claim_id: str) -> Decimal:
)
def claim_settled_total(data: ContributionData, claim: dict[str, Any]) -> Decimal:
allocated = allocated_total(data, str(claim.get("claim_id", "")))
if claim_total(claim) < 0:
return abs(allocated).quantize(CENT)
return allocated.quantize(CENT)
def payment_allocated_total(data: ContributionData, payment_id: str) -> Decimal:
return sum(
(