- Gäste, Buchungen (Status-Workflow), Sperrzeiten, Sonderangebote - Vorreservierung mit Haltezeit je Wohnung; abgelaufene Holds geben den Kalender sofort frei, Cron setzt Status und benachrichtigt - Sonderangebote/Sonderkonditionen: %, € pro Aufenthalt, Sonderpreis/Nacht, Gratis-Nächte; Bedingungen u. a. Saison, Vorlauf, Wochentag, Nächte, Aktionscode; bestes Einzel- vs. kombinierte Angebote - Öffentliche Seite /buchen: Belegungskalender, Live-Preis, Anfrageformular (Honeypot, Rate-Limit) - E-Mails: Angebot an Gast, Benachrichtigung Vermieter, Bestätigung, Absage, Ablauf - Filament: Anfragen & Buchungen (bestätigen, ablehnen, verlängern, stornieren, Telefonbuchung), Gäste, Sperrzeiten, Sonderangebote - Deutsche Validierungstexte Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
88 lines
5.0 KiB
PHP
88 lines
5.0 KiB
PHP
<?php
|
||
|
||
namespace App\Filament\Resources\Bookings\Schemas;
|
||
|
||
use App\Models\Booking;
|
||
use App\Support\Money;
|
||
use Filament\Infolists\Components\RepeatableEntry;
|
||
use Filament\Infolists\Components\RepeatableEntry\TableColumn;
|
||
use Filament\Infolists\Components\TextEntry;
|
||
use Filament\Schemas\Components\Grid;
|
||
use Filament\Schemas\Components\Section;
|
||
use Filament\Schemas\Schema;
|
||
|
||
class BookingInfolist
|
||
{
|
||
public static function configure(Schema $schema): Schema
|
||
{
|
||
return $schema
|
||
->columns(3)
|
||
->components([
|
||
Grid::make(1)
|
||
->columnSpan(2)
|
||
->schema([
|
||
Section::make('Aufenthalt')
|
||
->columns(3)
|
||
->schema([
|
||
TextEntry::make('property.name')->label('Wohnung'),
|
||
TextEntry::make('arrival')->label('Anreise')->date('l, d.m.Y'),
|
||
TextEntry::make('departure')->label('Abreise')->date('l, d.m.Y'),
|
||
TextEntry::make('nights')->label('Nächte')->state(fn (Booking $record): int => $record->nights()),
|
||
TextEntry::make('guests')->label('Personen'),
|
||
TextEntry::make('promo_code')->label('Aktionscode')->placeholder('–'),
|
||
]),
|
||
Section::make('Preis')
|
||
->schema([
|
||
RepeatableEntry::make('quote.lines')
|
||
->hiddenLabel()
|
||
->table([
|
||
TableColumn::make('Leistung'),
|
||
TableColumn::make('Betrag')->alignEnd(),
|
||
])
|
||
->schema([
|
||
TextEntry::make('label'),
|
||
TextEntry::make('amount')->formatStateUsing(fn (int $state): string => Money::format($state))->alignEnd(),
|
||
]),
|
||
Grid::make(4)->schema([
|
||
TextEntry::make('total')->label('Gesamtpreis')->money('EUR', divideBy: 100, locale: 'de')->weight('bold'),
|
||
TextEntry::make('deposit')->label('Anzahlung')->money('EUR', divideBy: 100, locale: 'de'),
|
||
TextEntry::make('balance')->label('Restzahlung')->state(fn (Booking $record): string => Money::format($record->total - $record->deposit)),
|
||
TextEntry::make('balance_due_on')->label('Rest fällig am')->date('d.m.Y'),
|
||
]),
|
||
]),
|
||
Section::make('Nachricht des Gastes')
|
||
->visible(fn (Booking $record): bool => filled($record->message))
|
||
->schema([
|
||
TextEntry::make('message')->hiddenLabel(),
|
||
]),
|
||
]),
|
||
Grid::make(1)
|
||
->columnSpan(1)
|
||
->schema([
|
||
Section::make('Status')
|
||
->schema([
|
||
TextEntry::make('status')->label('Status')->badge(),
|
||
TextEntry::make('hold_expires_at')->label('Vorgemerkt bis')->dateTime('d.m.Y, H:i')->visible(fn (Booking $record): bool => $record->hold_expires_at !== null),
|
||
TextEntry::make('confirmed_at')->label('Bestätigt am')->dateTime('d.m.Y, H:i')->visible(fn (Booking $record): bool => $record->confirmed_at !== null),
|
||
TextEntry::make('created_at')->label('Eingegangen')->dateTime('d.m.Y, H:i'),
|
||
TextEntry::make('source')->label('Quelle'),
|
||
]),
|
||
Section::make('Gast')
|
||
->schema([
|
||
TextEntry::make('guest.full_name')->label('Name'),
|
||
TextEntry::make('guest.email')->label('E-Mail')->copyable(),
|
||
TextEntry::make('guest.phone')->label('Telefon')->placeholder('–'),
|
||
TextEntry::make('guest_address')
|
||
->label('Adresse')
|
||
->state(fn (Booking $record): ?string => collect([$record->guest->street, trim("{$record->guest->postal_code} {$record->guest->city}")])->filter()->implode(', ') ?: null)
|
||
->placeholder('–'),
|
||
]),
|
||
Section::make('Interne Notizen')
|
||
->schema([
|
||
TextEntry::make('internal_notes')->hiddenLabel()->placeholder('Keine Notizen'),
|
||
]),
|
||
]),
|
||
]);
|
||
}
|
||
}
|