Commit Graph
134 Commits
Author SHA1 Message Date
Marcel PeterkauandClaude Sonnet 5 cc4aaef895 Copy directly-sent e-mails to an IMAP Sent folder, with a live folder picker
A raw SMTP send has no server-side "Sent" copy on its own (unlike IMAP
drafts, which are inherently server-side) -- add an opt-in checkbox plus a
configurable target folder so directly sent Mahnungen/SEPA-info-mails still
show up in the account's Gesendet/Sent folder like a normal mail client
would leave them. Applies only to "send" delivery; drafts already live on
the server by definition.

Both the Entwürfe- and Gesendet-folder fields are now editable comboboxes:
a new "Ordnerliste laden" button fetches the real folder list from the IMAP
server (needs working credentials first) via LIST, decoding folder names
from modified UTF-7 (RFC 3501) so names like "Entwürfe" render correctly
instead of as "Entw&APw-rfe". Free text still works -- ensure_imap_folder()
creates the folder on first use if it doesn't exist yet, checked once per
batch rather than before every single message.

mail_delivery.append_to_imap_drafts() became the more general
append_message(client, content, folder=, flags=), reused for both the
\Draft and \Seen cases.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 04:34:34 +02:00
Marcel PeterkauandClaude Sonnet 5 6b0da82b45 Add configurable e-mail delivery: direct SMTP send or IMAP drafts
Mahnungs- and SEPA-info-mails could previously only be saved as a local .eml
file that still had to be manually imported into Thunderbird. Add a per-store
"E-Mail-Versand" configuration (Optionen -> E-Mail-Versand, stored in
repository.json alongside the rest of the club's settings, since different
stores may use different mailboxes) with four delivery modes:

- "Lokal speichern": today's behaviour, unchanged default for existing stores.
- "Direkt versenden": sends via SMTP.
- "Als Entwurf ablegen": IMAP APPENDs into a configurable drafts folder, so it
  shows up live in whatever mail client is already watching that account.
- "Jedes Mal fragen": prompts once per generation action (not per e-mail --
  a SEPA batch can cover dozens of members) with Senden/Entwürfe/Abbrechen.

New ccma.services.mail_delivery module (smtplib/imaplib, no new dependency)
opens one authenticated connection per batch and reuses it across all
messages instead of reconnecting per recipient. Both "Verbindung testen"
buttons in Options exercise the same connection path used for real delivery.
The archived per-member copy of every generated e-mail is unaffected and
still always written regardless of delivery mode.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 04:34:34 +02:00
Marcel Peterkau b7554478ac Merge remote-tracking branch 'origin/dev' into feature/sepa-export-selection 2026-08-15 04:33:46 +02:00
Git-CI cba463a648 ci: bump dev version to 0.1.0-dev14 [skip ci] 2026-08-15 04:06:10 +02:00
Marcel Peterkau f5c8d81057 Merge pull request 'Feature/housekeeper overdue anniversary fixes' (#20) from feature/housekeeper-overdue-anniversary-fixes into dev
Reviewed-on: https://git.hiabuto.net/C3MA/CCMA/pulls/20
Reviewed-by: Matcha <20+matcha@noreply.git.hiabuto.net>
2026-08-15 02:04:34 +00:00
Marcel Peterkau 85a865fa0e Merge branch 'dev' into feature/sepa-export-selection 2026-08-15 02:02:14 +00:00
Marcel Peterkau 4951d81ea3 Merge branch 'dev' into feature/housekeeper-overdue-anniversary-fixes 2026-08-15 02:02:02 +00:00
Git-CI e7fdde8691 ci: bump dev version to 0.1.0-dev13 [skip ci] 2026-08-15 04:01:12 +02:00
Marcel Peterkau 4e2595cec4 Merge pull request 'Feature/failed direct debit' (#19) from feature/failed-direct-debit into dev
Reviewed-on: https://git.hiabuto.net/C3MA/CCMA/pulls/19
Reviewed-by: Matcha <20+matcha@noreply.git.hiabuto.net>
2026-08-15 01:59:06 +00:00
Marcel Peterkau aa5829acb0 Merge branch 'dev' into feature/failed-direct-debit 2026-08-15 01:58:19 +00:00
Git-CI 76e0e8326c ci: bump dev version to 0.1.0-dev12 [skip ci] 2026-08-15 03:55:12 +02:00
Marcel Peterkau f861732131 Merge pull request 'Feature/housekeeper run single member' (#18) from feature/housekeeper-run-single-member into dev
Reviewed-on: https://git.hiabuto.net/C3MA/CCMA/pulls/18
Reviewed-by: Matcha <20+matcha@noreply.git.hiabuto.net>
2026-08-15 01:53:27 +00:00
Marcel PeterkauandClaude Sonnet 5 2ce764b007 Document the SEPA export multi-select feature
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:51:52 +02:00
Marcel PeterkauandClaude Sonnet 5 bfb65b2583 Let individual SEPA debits be excluded from an export, not just all-or-nothing
The SEPA export dialog always exported every pending direct debit in the
filtered date range with no way to hold one back -- e.g. a member whose
Rücklastschrift is still being clarified had to either be collected again
regardless or the whole run skipped. The table now supports multi-select
(everything selected by default) and the CSV/XML/mail exports only include
the currently selected rows. Deselection survives the refresh() that
_prepare() runs right before exporting (tracked by member_id, not row index,
so a debit newly appearing after a requery still defaults to selected).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:51:32 +02:00
Marcel PeterkauandClaude Sonnet 5 d87a57775e Document the SEPA overdue-during-active-Mahnung fix
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:45:49 +02:00
Marcel PeterkauandClaude Sonnet 5 25f5d51d77 Stop flagging SEPA members with a running Rücklastschrift-Mahnung as overdue
sepa_debit_overdue fired unconditionally for every overdue SEPA claim past the
grace period, regardless of whether a reminder had already been sent for it --
so a Rücklastschrift-Mahnung created via the reminder mechanism made no
difference to the housekeeper output. Check for an already-sent reminder whose
own payment deadline hasn't expired yet first; if there is one, show a
low-priority "Rücklastschriftklärung läuft" note instead, mirroring the
non-SEPA "reminder_awaiting_deadline" fix. Once that deadline passes without
resolution, the plain sepa_debit_overdue notice returns.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:45:27 +02:00
Marcel PeterkauandClaude Sonnet 5 a1fb2f4e30 Refresh the member tab after a single-member housekeeper run
_execute_housekeeper_run() showed the success dialog but never called
refresh()/on_changed(), so retroactively created claims/payments stayed
invisible in the currently open Mitgliedsakte until it was closed and
reopened, and the overview list wasn't notified either. Match the pattern
used by every other mutating action in this file (save, payment, credit,
reminder, ...): refresh the tab's own contribution lists and notify the
overview callback right after the run succeeds.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:40:40 +02:00
Marcel PeterkauandClaude Sonnet 5 0641285681 Document the housekeeper overdue-severity and ended-member reminder fixes
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:32:07 +02:00
Marcel PeterkauandClaude Sonnet 5 56a3f5f037 Fix housekeeper false-positive overdue errors and ended-member birthday/anniversary noise
An overdue claim whose reminder had already been sent, with that reminder's own
payment deadline still running, fell through to the plain "überfällig" error
finding whenever reminder_due's escalation check returned None to signal "not
yet time for the next Mahnstufe" -- that None was indistinguishable from "never
handled at all" to the caller, so it looked neglected even though a reminder was
already out. Give that case its own low-priority "reminder_awaiting_deadline"
finding instead of silently falling back to the overdue-error path.

Birthday and membership-anniversary findings also kept firing for members whose
status is "ended", which doesn't make sense once the membership itself is over.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:20:18 +02:00
Marcel PeterkauandClaude Sonnet 5 4ecdf87d05 Document the multi-item/Rücklastschrift reminder feature and reminder editing
Catches up the changelog for the reminder items table, the configurable
Mahnungen policy in Options, and today's ability to edit reminders (incl.
undoing an already-sent one).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:13:23 +02:00
Marcel PeterkauandClaude Sonnet 5 186af530b0 Allow editing reminders (incl. undoing "sent") and prefill a Rücklastschrift reason
A generated/sent Mahnung email couldn't be corrected before: sent reminders were
locked, so a wording mistake meant living with it. Add edit_reminder_draft() for
draft/generated reminders and revert_reminder_sent() to safely undo a "sent"
reminder (removing the fee items it booked, refusing if a payment already covers
them or a higher Mahnstufe already exists) so it can be edited and resent.

ReminderDialog now supports an edit mode (reminder=... prefills name/detail/
items/deadline/channel, level stays fixed) and claim_tab gained a "Mahnung
bearbeiten" button that reverts-then-edits for sent reminders automatically,
asking for confirmation first since it un-books the fee.

The Rücklastschrift preset now also prefills "Details" with a short explanation
("Leider konnte die Lastschrift ... nicht eingelöst werden.") since that field
goes straight into the reminder email -- the board can append the concrete
reason (mangels Deckung, Konto ungültig, ...) right there instead of the field
starting empty.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:13:04 +02:00
Marcel PeterkauandClaude Sonnet 5 f3bdffd347 Make ReminderDialog resizable/wider and fix Options dialog bottom clipping
ReminderDialog: override the shared dialog base's resizable(False, False),
widen the initial layout, and pin the items-table edit row's amount field
to the exact same pixel width as the table's fixed "amount" column (via a
pack_propagate(False) frame) while the description field stretches like
the table's own column does -- keeps alignment exact even after resizing.

OptionsDialog: compute the window's initial geometry from its actual
required size after all tabs (incl. "Mahnungen") are built, instead of a
static guess that clipped the Mahnungen tab's tables/buttons at the bottom.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:13:04 +02:00
Marcel PeterkauandClaude Sonnet 5 3940926a22 Line up the reminder items edit row with the table columns
Beschreibung/Betrag now sit on their own row directly under the table,
sized to the same 220:100 ratio as the table's own columns, with the
Hinzufügen/Aktualisieren/Entfernen buttons moved to a row below that
instead of everything being crammed into one row.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:13:04 +02:00
Marcel PeterkauandClaude Sonnet 5 d4dfd0066a Fix reminder dialog sizing, item editing, and old-repo fee defaults
The dialog's base class sets resizable(False, False) before this
subclass's content (including the preset-populated items table) exists,
so its initial size stayed locked to a too-small guess and cut off the
bottom. It now explicitly sizes to its actual content after everything,
including the selected preset's items, has been built.

The items table only supported add/remove -- there was no way to change
an already-added row's amount (e.g. after picking the Rücklastschrift
preset, its prefilled fee couldn't be adjusted). Selecting a row now
loads it into the description/amount fields, and a new "Aktualisieren"
button applies edits back to that row.

The Rücklastschrift preset label was missing the "Stufe N:" prefix the
other presets have, inconsistent for no reason.

Also fixed a real gap: repositories created before standard_fee_items
existed had no such key in repository.json at all, so Optionen showed
an empty Standardpositionen table instead of the built-in defaults.
get_reminder_policy() now backfills the defaults when the key is
missing entirely, while still respecting a list the board intentionally
emptied and saved.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:13:04 +02:00
Marcel PeterkauandClaude Sonnet 5 a1719cad5e Handle failed direct debits through the same reminder mechanism
A Rücklastschrift is still the member's own failure to ensure cover or
provide valid bank details, so it belongs in the same escalation ladder
as a regular reminder -- it now occupies whatever level the claim is next
due for, alongside a "Rücklastschrift" preset next to the existing
Mahnstufe presets.

Mahnung vorbereiten no longer lets the board pick a level (it's computed
automatically from what's already been sent, since the sequencing was
already server-enforced) and replaces the single fee field with a small
items table (Beschreibung + Betrag), so a reminder can carry several
charges at once -- e.g. Rücklastschriftgebühr plus Bankgebühr plus Porto
-- each landing on the claim as its own line item instead of one lump
sum under a generic label. The description field offers the configured
standard texts but stays free-editable.

Those standard texts and amounts, plus the dunning levels themselves
(name/fee/deadline), are now configurable from Optionen -> Mahnungen
instead of only being editable by hand-editing repository.json, which
was the case for the whole reminder policy until now. Cleaned up
reminder_fee/failed_debit_fee on contribution rules while at it -- both
were unused leftovers superseded by this.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:13:04 +02:00
Marcel PeterkauandClaude Sonnet 5 46795fc110 Reword the single-member housekeeper changelog entry so the PR carries a real diff
A prior push mixup (feature/member-contribution-overrides' origin ref had
briefly advanced to include this branch's own "Document the single-member
housekeeper run feature" commit) meant that commit's changelog line already
rode along into dev through PR #17 -- without the actual feature code, which
only exists here. CI's PR gate expects CHANGELOG.json to differ from dev, but
the merged text was already byte-identical, so this branch's PR couldn't pass.
Rewording the entry (adding the actual "Mitgliedsakte" entry point) keeps it
accurate and gives this branch a real changelog diff again.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 03:12:44 +02:00
Marcel Peterkau 227ba8b128 Merge branch 'dev' into feature/housekeeper-run-single-member 2026-08-14 23:35:49 +00:00
Git-CI 7144d961c7 ci: bump dev version to 0.1.0-dev11 [skip ci] 2026-08-15 01:30:42 +02:00
Marcel Peterkau 0a70776154 Merge pull request 'Feature/member contribution overrides' (#17) from feature/member-contribution-overrides into dev
Reviewed-on: https://git.hiabuto.net/C3MA/CCMA/pulls/17
Reviewed-by: Matcha <20+matcha@noreply.git.hiabuto.net>
2026-08-14 23:29:05 +00:00
Marcel Peterkau e0125d008f Merge branch 'dev' into feature/member-contribution-overrides 2026-08-14 23:27:30 +00:00
Git-CI 7596f94444 ci: bump dev version to 0.1.0-dev10 [skip ci] 2026-08-15 01:27:15 +02:00
Marcel Peterkau 9cd611aeba Merge branch 'dev' into feature/member-contribution-overrides 2026-08-14 23:25:16 +00:00
Marcel Peterkau 171ba6bf28 Merge pull request 'Feature/allocation amount prefill' (#16) from feature/allocation-amount-prefill into dev
Reviewed-on: https://git.hiabuto.net/C3MA/CCMA/pulls/16
Reviewed-by: Matcha <20+matcha@noreply.git.hiabuto.net>
2026-08-14 23:24:56 +00:00
Marcel PeterkauandClaude Sonnet 5 ee99577b20 Run the housekeeper for a single member, optionally retroactively
Add a "Hausmeister für dieses Mitglied" button to the member view. It
runs every rule scoped to just that member -- e.g. after editing a
contribution override or payment frequency, to recompute their claims on
demand instead of waiting for or triggering a full run over every
member. A checkbox lets the board force retroactive claim creation for
just that one run, without changing the application-wide default
setting.

Housekeeper.run() gained member_id and retroactive_claims parameters.
Scoping to one member skips the asset checks and leaves every other
member's tasks completely untouched, since their rules never ran this
pass and so fall outside the resolved-scope set that
_resolve_stale_tasks uses to decide what to clear.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 00:59:01 +02:00
Marcel PeterkauandClaude Sonnet 5 c07bdff04e Document the single-member housekeeper run feature
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 00:58:10 +02:00
Marcel PeterkauandClaude Sonnet 5 1e29cc1e3d Document allocation prefill and membership fee override features
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 00:58:10 +02:00
Marcel PeterkauandClaude Sonnet 5 2484a1631d Add individually agreed membership fees (contribution overrides)
Members are sometimes given a fee that deviates from the regular
schedule -- e.g. a reduced rate for students -- for a specific period.
Add a per-member "Beitrag" tab where such deviations can be recorded
with a month-granular date range (Ab/Bis), a mandatory reason, and
either a fixed annual amount or a percentage discount off whichever
base rate is in effect at the time.

Data model: ContributionData gets a contribution_overrides list, each
entry validated (month format, Bis >= Ab, non-overlapping ranges per
member, reason required) and CRUD'd through the repository
(record/update/delete/get_contribution_override), consistent with how
donations already work.

Integration: contribution_claims.py now computes each membership-fee
claim's amount month by month instead of a single rate for the whole
billing period, picking up whichever override (if any) covers each
individual month. That handles an override starting or ending mid
period correctly (e.g. a semiannual payer whose discount begins in
March) without changing behavior for members without overrides.
Already-created claims are never recalculated retroactively, matching
how changes to the global contribution rates already behave.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 00:57:51 +02:00
Marcel PeterkauandClaude Sonnet 5 44228dd7dd Document the payment allocation amount prefill in the changelog
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 00:57:32 +02:00
Marcel Peterkau 44af7df8e2 Merge branch 'dev' into feature/allocation-amount-prefill 2026-08-14 22:26:47 +00:00
Git-CI 5cbc5c3aad ci: bump dev version to 0.1.0-dev9 [skip ci] 2026-08-15 00:19:54 +02:00
Marcel Peterkau a91c4ddd24 Merge branch 'dev' into feature/allocation-amount-prefill 2026-08-14 22:18:21 +00:00
Marcel Peterkau 1c26f2ed0a Merge pull request 'Feature/table usability fixes' (#15) from feature/table-usability-fixes into dev
Reviewed-on: https://git.hiabuto.net/C3MA/CCMA/pulls/15
Reviewed-by: Matcha <20+matcha@noreply.git.hiabuto.net>
2026-08-14 22:18:14 +00:00
Marcel Peterkau 222fc1a337 Merge branch 'dev' into feature/allocation-amount-prefill 2026-08-14 22:03:49 +00:00
Marcel Peterkau 9bf62809b7 Merge branch 'dev' into feature/table-usability-fixes 2026-08-14 22:03:08 +00:00
Marcel PeterkauandClaude Sonnet 5 4906db3d55 Prefill the allocation amount when clicking an unallocated claim/donation
Clicking a claim or donation row in the payment allocation table used to
just show "0.00" if nothing was allocated to it yet, requiring the board
to type the amount by hand every time. It now suggests whichever is
smaller: what that claim/donation still has open, or what's left unused
of the payment -- so the common case is click the row, then Zuordnung
setzen, done. Rows that already have an allocation still show their
current value instead, so editing one isn't overwritten by the
suggestion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 00:02:37 +02:00
Marcel PeterkauandClaude Sonnet 5 52904a29b4 Document the table/pane usability tuning and GnuCash import improvements
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-14 23:56:51 +02:00
Marcel PeterkauandClaude Sonnet 5 195ae0e228 Replace the GnuCash import checkbox column with native multi-select
Selecting bookings to import now uses the Treeview's own multi-selection
(click, Ctrl+click, Shift+click for ranges) instead of a dedicated
checkbox column that had to be clicked precisely -- more standard and
much faster for marking many rows at once.

Bookings matching an existing payment's date+amount are no longer
blocked from selection; they're still flagged (red row, "Bereits
vorhanden"). If any selected booking is such a duplicate, importing now
asks whether to skip those or instead adopt the booking's description
onto the already-recorded payment. That relabeling is handled by a new
repository.update_payment_reference, which only touches the reference
and gnucash_transaction_id fields, leaving date/amount/allocations
untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-14 23:43:55 +02:00
Git-CI 3d81a728b1 ci: bump dev version to 0.1.0-dev8 [skip ci] 2026-08-14 23:42:28 +02:00
Marcel Peterkau 7440d18c35 Merge pull request 'Feature/housekeeper dunning rules' (#14) from feature/housekeeper-dunning-rules into dev
Reviewed-on: https://git.hiabuto.net/C3MA/CCMA/pulls/14
Reviewed-by: Matcha <20+matcha@noreply.git.hiabuto.net>
2026-08-14 21:40:48 +00:00
Marcel Peterkau d2f4c9588f Merge branch 'dev' into feature/housekeeper-dunning-rules 2026-08-14 21:40:12 +00:00