Portal-Direktbuchung erfassen, Kontaktdaten-Prozess, manueller Statuswechsel, Archiv, Filter, Menue Verwaltung/Einrichtung
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m38s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m38s
- Buchung erfassen: Buchungsweg Portal (Referenz, Portalpreis, ohne Kontaktdaten), Prozess bestaetigen/Vertrag sofort/nur erfassen - Buchungsakte: Kontaktdaten eintragen (automatisch oder manuell weiter), Gast um Kontaktdaten bitten, Status von Hand aendern, Archivieren - Liste: Filter Kanal, Anreisezeitraum, Kontaktdaten fehlen; Spalten ausblendbar; Archiv - Klaerung: verstaendlichere Texte, eigenstaendige Belegung mit Kanal gilt als geklaert (Gitea #4) - Akte per Button aus Liste und Belegungsplan erreichbar - Menue: Gruppen Verwaltung (Tagesgeschaeft) und Einrichtung (Konfiguration), einfache Ansicht auf 8 Punkte Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0c4187edaf
commit
5ba9ae08ab
37 files changed
+786
-82
No files matched your search
@@ -4,9 +4,12 @@
|
||||
|
||||
use App\Availability\OccupancyOverview;
|
||||
use App\Enums\BookingStatus;
|
||||
use App\Models\Channel;
|
||||
use App\Models\Property;
|
||||
use App\Support\CurrentProperty;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
@@ -18,7 +21,7 @@ class BookingsTable
|
||||
public static function configure(Table $table, ?int $guestId = null): Table
|
||||
{
|
||||
return $table
|
||||
->description('Eigene Anfragen und Buchungen sowie erkannte Portalreservierungen in einer Liste. Fehlende Gastzuordnungen lassen sich in den Details ergänzen; unbekannte Belegungen haben einen eigenen Klärungsbereich.')
|
||||
->description('Eigene Anfragen und Buchungen sowie erkannte Portalreservierungen in einer Liste. „Akte öffnen“ zeigt alles zu einem Vorgang: nächster Schritt, Vertrag, Zahlungen, Aufgaben und E-Mails. Fehlende Gastzuordnungen lassen sich in den Details ergänzen; unbekannte Belegungen haben einen eigenen Klärungsbereich.')
|
||||
->records(function (?string $search, ?string $sortColumn, ?string $sortDirection, array $filters, int $page, int|string $recordsPerPage) use ($guestId, $table): LengthAwarePaginator {
|
||||
$propertyId = filled($filters['property']['value'] ?? null) ? (int) $filters['property']['value'] : null;
|
||||
$records = app(OccupancyOverview::class)->records($propertyId, $guestId);
|
||||
@@ -32,6 +35,18 @@ public static function configure(Table $table, ?int $guestId = null): Table
|
||||
if ($filters['without_guest']['isActive'] ?? false) {
|
||||
$records = $records->where('guest_assigned', false);
|
||||
}
|
||||
if (filled($filters['channel']['value'] ?? null)) {
|
||||
$records = $records->where('channel_id', (int) $filters['channel']['value']);
|
||||
}
|
||||
if ($filters['contact_missing']['isActive'] ?? false) {
|
||||
$records = $records->filter(fn (array $record): bool => $record['record_type'] === 'booking' && blank($record['guest_email']));
|
||||
}
|
||||
if (filled($filters['period']['arrival_from'] ?? null)) {
|
||||
$records = $records->filter(fn (array $record): bool => $record['arrival'] >= $filters['period']['arrival_from']);
|
||||
}
|
||||
if (filled($filters['period']['arrival_until'] ?? null)) {
|
||||
$records = $records->filter(fn (array $record): bool => $record['arrival'] <= $filters['period']['arrival_until']);
|
||||
}
|
||||
if (filled($filters['kind']['value'] ?? null)) {
|
||||
$records = $records->where('record_type', $filters['kind']['value']);
|
||||
}
|
||||
@@ -41,6 +56,10 @@ public static function configure(Table $table, ?int $guestId = null): Table
|
||||
// Cancelled, declined and expired requests leave the main list (they stay available as archive).
|
||||
$records = $records->reject(fn (array $record): bool => in_array($record['status_key'], ['cancelled', 'declined', 'expired'], true));
|
||||
}
|
||||
if (! ($filters['show_closed']['isActive'] ?? false)) {
|
||||
// Bookings the landlord moved to the archive; they keep their whole history and show again with the archive filter.
|
||||
$records = $records->reject(fn (array $record): bool => $record['archived_booking']);
|
||||
}
|
||||
$column = in_array($sortColumn, ['arrival', 'departure', 'reference', 'guest', 'source', 'total'], true) ? $sortColumn : 'arrival';
|
||||
$records = $records->sortBy($column, SORT_REGULAR, $sortDirection === 'desc');
|
||||
$perPage = $recordsPerPage === 'all' ? max(1, $records->count()) : $recordsPerPage;
|
||||
@@ -50,15 +69,16 @@ public static function configure(Table $table, ?int $guestId = null): Table
|
||||
->defaultSort('arrival')->searchable()->recordAction(null)
|
||||
->columns([
|
||||
TextColumn::make('reference')->label('Nr. / Referenz')->sortable(),
|
||||
TextColumn::make('kind_label')->label('Art')->badge(),
|
||||
TextColumn::make('kind_label')->label('Art')->badge()->toggleable(),
|
||||
TextColumn::make('status')->label('Status')->badge()->color(fn (array $record): string => $record['color']),
|
||||
TextColumn::make('guest')->label('Gast / Namensinformation')->sortable()
|
||||
->description(fn (array $record): string => $record['guest_assigned'] ? ($record['guest_email'] ?? 'E-Mail unbekannt') : 'Gastzuordnung offen'),
|
||||
TextColumn::make('source')->label('Buchungskanal / Quelle')->sortable(),
|
||||
TextColumn::make('source')->label('Buchungskanal / Quelle')->sortable()->toggleable(),
|
||||
TextColumn::make('arrival')->label('Anreise')->date('d.m.Y')->sortable(),
|
||||
TextColumn::make('departure')->label('Abreise')->date('d.m.Y')->sortable()
|
||||
->description(fn (array $record): string => $record['nights'].' Nächte'),
|
||||
TextColumn::make('persons')->label('Personen')->placeholder('Unbekannt')->toggleable(isToggledHiddenByDefault: true),
|
||||
IconColumn::make('archived_booking')->label('Archiviert')->boolean()->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('total')->label('Bekannter Gesamtpreis')->money('EUR', divideBy: 100, locale: 'de')->placeholder('Unbekannt')->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('property')->label('Wohnung')->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
@@ -71,11 +91,17 @@ public static function configure(Table $table, ?int $guestId = null): Table
|
||||
...collect(BookingStatus::cases())->mapWithKeys(fn (BookingStatus $status): array => [$status->value => $status->getLabel()])->all(),
|
||||
'imported' => 'Im Portalkalender geführt', 'archived' => 'Nicht mehr im Kalenderfeed',
|
||||
]),
|
||||
SelectFilter::make('channel')->label('Buchungskanal')->options(fn (): array => Channel::query()->orderBy('name')->pluck('name', 'id')->all()),
|
||||
Filter::make('period')->label('Anreise im Zeitraum')->schema([
|
||||
DatePicker::make('arrival_from')->label('Anreise ab'),
|
||||
DatePicker::make('arrival_until')->label('Anreise bis'),
|
||||
])->columns(2),
|
||||
Filter::make('upcoming')->label('Nur kommende Aufenthalte'),
|
||||
Filter::make('show_closed')->label('Archiv anzeigen (storniert, abgelehnt, abgelaufen)'),
|
||||
Filter::make('contact_missing')->label('Kontaktdaten des Gastes fehlen'),
|
||||
Filter::make('show_closed')->label('Archiv anzeigen (archiviert, storniert, abgelehnt, abgelaufen)'),
|
||||
Filter::make('without_guest')->label('Gastzuordnung offen'),
|
||||
])
|
||||
->recordUrl(fn (array $record): string => $record['url'])
|
||||
->recordActions([Action::make('view')->label('Details')->url(fn (array $record): string => $record['url'])]);
|
||||
->recordActions([Action::make('view')->label(fn (array $record): string => $record['record_type'] === 'booking' ? 'Akte öffnen' : 'Details')->icon('heroicon-o-folder-open')->button()->color('primary')->url(fn (array $record): string => $record['url'])]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user