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
+21
View File
@@ -3,8 +3,10 @@ from decimal import Decimal
import pytest
from ccma.domain.contributions import (
allocated_total,
claim_balance,
claim_items,
claim_settled_total,
claim_status,
claim_total,
payment_allocated_total,
@@ -102,6 +104,25 @@ def test_payment_can_be_split_across_multiple_claims(tmp_path) -> None:
)
def test_credit_claim_settlement_is_displayed_as_positive_amount() -> None:
claim = {"claim_id": "claim-1", "title": "Kautionsrückzahlung", "amount": "-25.00"}
data = ContributionData(
claims=[claim],
credits=[{"credit_id": "credit-1", "amount": "25.00"}],
allocations=[
{
"allocation_id": "allocation-1",
"claim_id": "claim-1",
"credit_id": "credit-1",
"amount": "25.00",
}
],
)
assert allocated_total(data, "claim-1") == Decimal("-25.00")
assert claim_settled_total(data, claim) == Decimal("25.00")
def test_reminder_fee_increases_claim_and_is_audited(tmp_path) -> None:
repository, member = _repository_with_claim(tmp_path)