mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-08-25 06:55:17 +02:00
feat: add SEPA direct debit exports and notifications
This commit is contained in:
@@ -147,6 +147,36 @@ def test_payment_can_be_split_across_multiple_claims(tmp_path) -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_combined_dummy_payment_settles_multiple_claims(tmp_path) -> None:
|
||||
repository, member = _repository_with_claim(tmp_path)
|
||||
data = repository.get_contributions(member.member_id)
|
||||
data.claims.append(
|
||||
{
|
||||
"claim_id": "claim-2",
|
||||
"title": "Zweite Forderung",
|
||||
"amount": "50.00",
|
||||
"due_date": "2019-12-31",
|
||||
"status": "open",
|
||||
}
|
||||
)
|
||||
repository.save_contributions(member.member_id, data)
|
||||
|
||||
payment = repository.record_combined_payment(
|
||||
member.member_id,
|
||||
payment_date="2019-12-31",
|
||||
allocations={"claim-1": "100.00", "claim-2": "50.00"},
|
||||
method="dummy",
|
||||
reference="Altbestand",
|
||||
)
|
||||
|
||||
changed = repository.get_contributions(member.member_id)
|
||||
assert payment["amount"] == "150.00"
|
||||
assert payment["method"] == "dummy"
|
||||
assert payment_allocated_total(changed, payment["payment_id"]) == Decimal("150.00")
|
||||
assert all(claim_balance(changed, claim) == 0 for claim in changed.claims)
|
||||
assert repository.get_events(member.member_id)[-1].data["method"] == "dummy"
|
||||
|
||||
|
||||
def test_payment_allocation_cannot_overpay_claim(tmp_path) -> None:
|
||||
repository, member = _repository_with_claim(tmp_path, amount="12.50")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user