feat(admin): Anzahlungskonten in der Verwaltung pflegen (zwei IBANs)

- Migration 016_deposit_accounts.sql: Tabelle deposit_accounts (label, holder,
  bank, iban, sort_order), gefüllt mit Postbank (DE12 …1261 30) und Sparkasse
  (DE83 3206 0362 3303 2140 10); bookings.deposit_account -> deposit_account_id
  mit Fremdschlüssel (ON DELETE SET NULL), Altbestand wird aufs erste Konto
  gemappt; schema.sql nachgezogen
- Neue Seite Verwaltung → Konten (/admin/accounts): anlegen, ändern, löschen
  (Löschen nur ohne Buchungsbezug), Anzeige der Verwendung je Konto
- Buchungsformular wählt aus dieser Liste (Anzeige mit IBAN-Ende), Validierung
  prüft IBAN-Format, Auftragsbestätigung druckt das gewählte Konto
- deposit_accounts()/deposit_account() lesen aus der DB (Cache wird nach
  Änderungen verworfen); Konfigurations-Override entfällt
- Anleitung (Abschnitt 3 und 15), README, config.example.php und ROADMAP
  (Feature 25) aktualisiert
This commit is contained in:
torsten 2026-11-30 17:10:24 +01:00
parent bf85a64a79
commit cc8d7330f8
15 changed files with 478 additions and 76 deletions

View file

@ -823,7 +823,7 @@ function form_values_from_input(array $data): array
'end_time' => (string) ($data['end_time'] ?? ''),
'deposit' => number_format($data['deposit_cents'] / 100, 2, ',', ''),
'deposit_required' => (int) ($data['deposit_required'] ?? 0),
'deposit_account' => (string) ($data['deposit_account'] ?? ''),
'deposit_account_id' => (int) ($data['deposit_account_id'] ?? 0),
'rent' => number_format($data['rent_cents'] / 100, 2, ',', ''),
'delivery' => number_format($data['delivery_cents'] / 100, 2, ',', ''),
'invoice' => (int) $data['invoice'],
@ -877,7 +877,7 @@ function page_booking_new(array $user, string $method): void
'end_time' => '',
'deposit' => '',
'deposit_required' => 0,
'deposit_account' => '',
'deposit_account_id' => (int) (deposit_accounts()[0]['id'] ?? 0),
'rent' => '',
'delivery' => '',
'invoice' => 0,
@ -933,7 +933,7 @@ function page_booking_edit(array $user, int $id, string $method): void
'end_time' => (string) ($booking['end_time'] ?? ''),
'deposit' => number_format((int) $booking['deposit_cents'] / 100, 2, ',', ''),
'deposit_required' => (int) ($booking['deposit_required'] ?? 0),
'deposit_account' => (string) ($booking['deposit_account'] ?? ''),
'deposit_account_id' => (int) ($booking['deposit_account_id'] ?? 0) ?: (int) (deposit_accounts()[0]['id'] ?? 0),
'rent' => number_format((int) $booking['rent_cents'] / 100, 2, ',', ''),
'delivery' => number_format((int) $booking['delivery_cents'] / 100, 2, ',', ''),
'invoice' => (int) $booking['invoice'],
@ -959,7 +959,7 @@ function page_booking_edit(array $user, int $id, string $method): void
if (!$canEditBilling) {
$data['deposit_cents'] = (int) $booking['deposit_cents'];
$data['deposit_required'] = (int) ($booking['deposit_required'] ?? 0);
$data['deposit_account'] = (string) ($booking['deposit_account'] ?? '');
$data['deposit_account_id'] = (int) ($booking['deposit_account_id'] ?? 0);
$data['rent_cents'] = (int) $booking['rent_cents'];
$data['delivery_cents'] = (int) $booking['delivery_cents'];
$data['total_cents'] = (int) $booking['total_cents'];