mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-07-01 11:14:52 +02:00
Show credit settlements as positive amounts
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user