mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-08-24 22:45:18 +02:00
Show credit settlements as positive amounts
This commit is contained in:
@@ -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(
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user