Stornoregeln mit automatischer Kostenberechnung, Storno-Verwaltung, Vertragsanlagen
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m34s

- Stornoregel (Stufen nach Tagen vor Anreise, Mietpreis oder Gesamtpreis, Ersatzmieter-Gebuehr), je Vertragsvorlage,
  beim Angebot eingefroren, als Platzhalter im Vertrag
- Stornierung (Gast-Link oder Verwaltung) berechnet die Kosten, legt einen Stornofall an; Verwaltung Stornierungen
  mit Vorschlag, Festlegung, Saldo, Abrechnung und Erlass; Gast sieht die Kosten vorab auf der Storno-Seite
- Vertragsanlagen als eigene versionierte Dokumente mit Bedingung (immer, Zusatzleistung, Portal, von Hand),
  je Angebot ausgewaehlt und eingefroren; Zusatzleistungen in der Buchung erfassbar
- FeWo-direkt-Installation legt die Stornoregel aus Paragraf 13 an

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-10-30 16:32:48 +01:00
1 parent 5baf39441f
commit 0c4187edaf
37 files changed
+1440 -10

No files matched your search

+15 -1
View File
@@ -8,6 +8,7 @@
use App\Enums\ChannelBookingModel;
use App\Models\Booking;
use App\Models\BookingTask;
use App\Models\Cancellation;
use Carbon\CarbonImmutable;
/**
@@ -91,6 +92,19 @@ public static function steps(Booking $booking): array
return $steps;
}
private static function cancelledText(Booking $booking, bool $open): string
{
$cancellation = Cancellation::query()->where('booking_id', $booking->id)->first();
if ($cancellation === null) {
return $open ? 'Stornokosten bzw. Rückzahlung sind noch zu klären (siehe Aufgaben).' : 'Nichts mehr zu tun. Die Buchung bleibt zur Historie erhalten.';
}
$balance = $cancellation->balance();
$text = 'Storniert am '.$cancellation->cancelled_on->format('d.m.Y').' ('.($cancellation->days_before ?? '?').' Tage vor Anreise). Stornokosten '.Money::format($cancellation->fee()).', bezahlt '.Money::format($cancellation->paid_amount).'.';
return $text.($cancellation->status === Cancellation::OPEN ? ($balance > 0 ? ' Noch einzufordern: '.Money::format($balance).'.' : ($balance < 0 ? ' Zu erstatten: '.Money::format(-$balance).'.' : ' Ausgeglichen – bitte als abgerechnet markieren.')) : ' Erledigt.');
}
/**
* @return array{title: string, text: string, color: string}
*/
@@ -109,7 +123,7 @@ public static function next(Booking $booking): array
}
return match (true) {
$booking->status === BookingStatus::Cancelled => ['title' => 'Storniert', 'text' => $costs !== null || $wish !== null ? 'Stornokosten bzw. Rückzahlung sind noch zu klären (siehe Aufgaben).' : 'Nichts mehr zu tun. Die Buchung bleibt zur Historie erhalten.', 'color' => $costs !== null ? 'warning' : 'gray'],
$booking->status === BookingStatus::Cancelled => ['title' => 'Storniert', 'text' => self::cancelledText($booking, $costs !== null || $wish !== null), 'color' => $costs !== null ? 'warning' : 'gray'],
$booking->status === BookingStatus::Declined => ['title' => 'Abgelehnt', 'text' => 'Der Zeitraum ist wieder frei.', 'color' => 'gray'],
$booking->status === BookingStatus::Expired => ['title' => 'Abgelaufen', 'text' => 'Die Haltefrist ist verstrichen. Sie können die Anfrage trotzdem noch bestätigen, solange der Zeitraum frei ist.', 'color' => 'gray'],
$booking->status === BookingStatus::Reserved => ['title' => 'Anfrage prüfen', 'text' => $kind === self::PORTAL_BOOKING