Zentralen Belegungsplan und plattformuebergreifende Buchungs- und Gaesteverwaltung integrieren
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m41s

This commit is contained in:
Lars committed 2026-10-27 21:51:56 +01:00
1 parent c74199e978
commit f369018a68
41 files changed
+1343 -157

No files matched your search

@@ -20,25 +20,26 @@ public static function configure(Table $table): Table
$countedBookings = ['bookings' => fn (Builder $query): Builder => $query->whereIn('status', BookingStatus::occupying())];
return $table
->modifyQueryUsing(fn (Builder $query): Builder => $query->withCount('portalStays'))
->defaultSort('last_name')
->columns([
TextColumn::make('last_name')
->label('Name')
->formatStateUsing(fn (Guest $record): string => "{$record->last_name}, {$record->first_name}")
->description(fn (Guest $record): string => $record->email)
->formatStateUsing(fn (Guest $record): string => $record->full_name)
->description(fn (Guest $record): string => $record->email ?? 'E-Mail unbekannt')
->searchable(['first_name', 'last_name', 'email'])
->sortable(),
TextColumn::make('phone')->label('Telefon')->placeholder('–'),
TextColumn::make('city')->label('Ort')->placeholder('–')->toggleable(),
TextColumn::make('tags')->label('Markierungen')->badge(),
TextColumn::make('bookings_count')->label('Aufenthalte')->counts($countedBookings)->sortable(),
TextColumn::make('bookings_sum_total')->label('Umsatz')->sum($countedBookings, 'total')->money('EUR', divideBy: 100, locale: 'de')->sortable(),
TextColumn::make('bookings_count')->label('Aufenthalte')->counts($countedBookings)->formatStateUsing(fn (Guest $record, int $state): int => $state + $record->portal_stays_count)->description('Eigene und zugeordnete Portalaufenthalte'),
TextColumn::make('bookings_sum_total')->label('Umsatz eigener Buchungen')->sum($countedBookings, 'total')->money('EUR', divideBy: 100, locale: 'de')->sortable(),
IconColumn::make('marketing_consent_at')->label('Angebote')->boolean()->getStateUsing(fn (Guest $record): bool => $record->marketing_consent_at !== null),
])
->filters([
Filter::make('returning')
->label('Stammgäste (ab 2 Aufenthalten)')
->query(fn (Builder $query): Builder => $query->has('bookings', '>=', 2)),
->query(fn (Builder $query): Builder => $query->where(fn (Builder $query) => $query->whereHas('bookings', fn (Builder $query) => $query->whereIn('status', BookingStatus::occupying()), '>=', 2)->orWhereHas('portalStays', null, '>=', 2)->orWhere(fn (Builder $query) => $query->whereHas('bookings', fn (Builder $query) => $query->whereIn('status', BookingStatus::occupying()))->whereHas('portalStays')))),
TernaryFilter::make('marketing_consent_at')
->label('Einwilligung Angebote')
->nullable(),