Decouple Q1/Q3 support payments from study proof requirement (STI-107) #1

Merged
Remmer merged 2 commits from fix/sti-107-q3-zahlungspipeline into main 2026-06-14 20:33:05 +00:00

2 Commits

Author SHA1 Message Date
SysAdmin Agent
e76f765d0c Add backfill_quarterly_payments command for one-off catch-up (STI-107)
Some checks are pending
CI/CD Pipeline / test (pull_request) Waiting to run
CI/CD Pipeline / deploy (pull_request) Blocked by required conditions
Code Quality / quality (pull_request) Waiting to run
Companion to the Q1/Q3 payment decoupling. Iterates active destinatare
with vierteljaehrlicher_betrag > 0 and IBAN set, finds or creates the
matching VierteljahresNachweis, and produces a DestinataerUnterstuetzung
via create_quarterly_support_payment() when the new is_complete_for_payment()
gate passes.

For Q3/2026 where the staff did not record income/assets reviews on every
destinatare before the 15.06. payment date, --force bypasses the gate and
inserts a 'geplant' payment directly, tagged "Backfill STI-107", so the
staff can still process it through the normal pipeline.

Supports --dry-run to preview without writing. Skips destinatare that
already have a payment for the same quarter and lists every skip reason
at the end.

Refs STI-107

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-14 20:25:01 +00:00
SysAdmin Agent
6d8b35a7da Decouple Q1/Q3 support payments from study proof requirement (STI-107)
Some checks are pending
CI/CD Pipeline / test (pull_request) Waiting to run
CI/CD Pipeline / deploy (pull_request) Blocked by required conditions
Code Quality / quality (pull_request) Waiting to run
Q3 support payments fall due on 15 June, but the matching study proof
deadline is 15 September of the same year. The previous gate
`VierteljahresNachweis.is_complete()` required the study proof to be
present, so `create_quarterly_support_payment()` returned None for every
Q3 entry — Q3/2026 payments never appeared in the pipeline even after
the staff manually updated the quarterly confirmation. The same
mismatch exists for Q1 (payment 15 December, study proof 15 March).

Introduce `is_complete_for_payment()` on VierteljahresNachweis that
skips the study proof check for Q1 and Q3 (where the study proof
falls due after the matching payment) while keeping the strict
`is_complete()` requirement for Q2 and Q4 (where both deadlines
coincide on 15 March / 15 September).

Use the new check in the payment-creation gate and in the status
transitions in `quarterly_confirmation_update`, `quarterly_confirmation_edit`,
and `quarterly_confirmation_reset`, so Q1/Q3 confirmations can reach
'eingereicht' on income+assets alone and the support payment is
created on the correct due date.

Refs STI-107

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-14 20:14:45 +00:00