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
@@ -5,7 +5,9 @@
|
||||
use App\Actions\CancelBooking;
|
||||
use App\Actions\ConfirmBooking;
|
||||
use App\Actions\DeclineBooking;
|
||||
use App\Actions\ProvideGuestContact;
|
||||
use App\Actions\SendOffer;
|
||||
use App\Actions\SetBookingStatus;
|
||||
use App\Documents\OfferTerms;
|
||||
use App\Documents\RentalContract;
|
||||
use App\Enums\BookingStatus;
|
||||
@@ -19,12 +21,14 @@
|
||||
use App\Pricing\PriceCalculator;
|
||||
use App\Pricing\QuoteException;
|
||||
use App\Pricing\StayRequest;
|
||||
use App\Support\BookingProgress;
|
||||
use App\Support\Money;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Radio;
|
||||
use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
@@ -127,6 +131,61 @@ protected function getHeaderActions(): array
|
||||
fn () => $send->handle($this->record, $this->offerChanges($data)),
|
||||
'Angebot gesendet',
|
||||
)),
|
||||
Action::make('provideContact')
|
||||
->label('Kontaktdaten eintragen')
|
||||
->icon(Heroicon::OutlinedUserPlus)
|
||||
->color(fn (): string => blank($this->record->guest?->email) ? 'warning' : 'gray')
|
||||
->visible(fn (): bool => ! in_array($this->record->status, [BookingStatus::Cancelled, BookingStatus::Declined, BookingStatus::Expired], true))
|
||||
->modalHeading('Kontaktdaten des Gastes')
|
||||
->modalDescription('Kontaktdaten aus Portalnachricht, E-Mail oder Telefonat. Danach kann der Vertragsprozess automatisch weiterlaufen oder von Hand fortgeführt werden.')
|
||||
->modalWidth('3xl')
|
||||
->fillForm(fn (): array => ['guest' => $this->record->guest->only(['first_name', 'last_name', 'email', 'phone', 'street', 'postal_code', 'city']), 'process' => ProvideGuestContact::MANUAL, 'guest_confirmed' => $this->record->guest_confirmed_at !== null])
|
||||
->schema([
|
||||
Section::make('Gast')->columns(2)->schema([
|
||||
TextInput::make('guest.first_name')->label('Vorname')->required()->maxLength(100),
|
||||
TextInput::make('guest.last_name')->label('Nachname')->required()->maxLength(100),
|
||||
TextInput::make('guest.email')->label('E-Mail')->email()->maxLength(255),
|
||||
TextInput::make('guest.phone')->label('Telefon')->tel()->maxLength(50),
|
||||
TextInput::make('guest.street')->label('Straße und Hausnummer')->maxLength(150),
|
||||
TextInput::make('guest.postal_code')->label('PLZ')->maxLength(20),
|
||||
TextInput::make('guest.city')->label('Ort')->maxLength(100),
|
||||
]),
|
||||
Section::make('Wie geht es weiter?')->schema([
|
||||
Radio::make('process')->hiddenLabel()->options([
|
||||
ProvideGuestContact::MANUAL => 'Nur speichern – den Vertragsprozess führe ich von Hand weiter',
|
||||
ProvideGuestContact::AUTOMATIC => 'Automatisch weiter: Portal-Buchung → Bestätigung und Vertrag per E-Mail, Anfrage → Angebot per E-Mail',
|
||||
])->required(),
|
||||
Toggle::make('guest_confirmed')->label('Der Gast hat die Buchung per E-Mail bestätigt'),
|
||||
]),
|
||||
])
|
||||
->action(function (array $data, ProvideGuestContact $provide): void {
|
||||
try {
|
||||
$message = $provide->handle($this->record, $data['guest'], $data['process'], (bool) $data['guest_confirmed']);
|
||||
} catch (ReservationException|QuoteException $exception) {
|
||||
Notification::make()->title('Nicht möglich')->body($exception->getMessage())->danger()->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->record->refresh();
|
||||
Notification::make()->title($message)->success()->send();
|
||||
}),
|
||||
Action::make('requestContact')
|
||||
->label('Gast um Kontaktdaten bitten')
|
||||
->icon(Heroicon::OutlinedChatBubbleLeftEllipsis)
|
||||
->color('gray')
|
||||
->visible(fn (): bool => blank($this->record->guest?->email) && ! in_array($this->record->status, [BookingStatus::Cancelled, BookingStatus::Declined, BookingStatus::Expired], true))
|
||||
->modalHeading('Gast um Kontaktdaten bitten')
|
||||
->modalDescription('Der Text lässt sich im Nachrichtenfenster des Portals einfügen (Sie senden ihn selbst). Mit „Als angefragt vermerken“ merkt sich die Buchungsakte, dass die Kontaktdaten erfragt wurden.')
|
||||
->modalSubmitActionLabel('Als angefragt vermerken')
|
||||
->fillForm(fn (): array => ['text' => $this->contactRequestText()])
|
||||
->schema([
|
||||
Textarea::make('text')->label('Nachricht an den Gast')->rows(10)->extraInputAttributes(['readonly' => true, 'onclick' => 'this.select()']),
|
||||
])
|
||||
->action(function (): void {
|
||||
$this->record->forceFill(['contact_requested_at' => now()])->saveQuietly();
|
||||
Notification::make()->title('Als angefragt vermerkt')->success()->send();
|
||||
}),
|
||||
Action::make('offerLink')
|
||||
->label('Angebotslink')
|
||||
->icon(Heroicon::OutlinedLink)
|
||||
@@ -250,6 +309,38 @@ protected function getHeaderActions(): array
|
||||
Textarea::make('internal_notes')->label('Interne Notizen')->rows(6),
|
||||
])
|
||||
->action(fn (array $data) => $this->record->update($data)),
|
||||
Action::make('setStatus')
|
||||
->label('Status von Hand ändern')
|
||||
->icon(Heroicon::OutlinedAdjustmentsHorizontal)
|
||||
->visible(fn (): bool => BookingProgress::kind($this->record) !== BookingProgress::OWN && $this->record->status !== BookingStatus::Declined)
|
||||
->modalHeading('Status von Hand ändern')
|
||||
->modalDescription('Für Buchungen, die das System nicht selbst weiterführt. Es werden keine E-Mails versendet. Wird die Buchung wieder verbindlich, prüft das System den Kalender. Stornieren und Ablehnen haben eigene Aktionen.')
|
||||
->schema([
|
||||
Select::make('status')->label('Neuer Status')->options(collect(SetBookingStatus::TARGETS)->mapWithKeys(fn (BookingStatus $status): array => [$status->value => $status->getLabel()])->all())->required(),
|
||||
Textarea::make('reason')->label('Grund / Anlass')->helperText('Wird in den internen Notizen festgehalten.')->required()->rows(2),
|
||||
])
|
||||
->action(function (array $data, SetBookingStatus $setStatus): void {
|
||||
try {
|
||||
$setStatus->handle($this->record, BookingStatus::from($data['status']), $data['reason'], auth()->user()->name);
|
||||
} catch (ReservationException $exception) {
|
||||
Notification::make()->title('Nicht möglich')->body($exception->getMessage())->danger()->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->record->refresh();
|
||||
Notification::make()->title('Status geändert')->success()->send();
|
||||
}),
|
||||
Action::make('archive')
|
||||
->label(fn (): string => $this->record->archived_at ? 'Aus dem Archiv holen' : 'Archivieren')
|
||||
->icon(Heroicon::OutlinedArchiveBox)
|
||||
->visible(fn (): bool => $this->record->archived_at !== null || $this->record->canBeArchived())
|
||||
->modalDescription(fn (): string => $this->record->archived_at ? 'Die Buchung erscheint wieder in der Liste.' : 'Die Buchung verschwindet aus der Standardliste. Verlauf, E-Mails, Zahlungen und Dokumente bleiben vollständig erhalten.')
|
||||
->requiresConfirmation()
|
||||
->action(function (): void {
|
||||
$this->record->update(['archived_at' => $this->record->archived_at ? null : now()]);
|
||||
Notification::make()->title($this->record->archived_at ? 'Archiviert' : 'Wieder aktiv')->success()->send();
|
||||
}),
|
||||
Action::make('cancel')
|
||||
->label('Stornieren')
|
||||
->icon(Heroicon::OutlinedNoSymbol)
|
||||
@@ -277,6 +368,21 @@ protected function getHeaderActions(): array
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Suggested message asking a portal guest for the contact data the contract needs.
|
||||
*/
|
||||
private function contactRequestText(): string
|
||||
{
|
||||
$booking = $this->record;
|
||||
$landlord = config('fewo.owner.name') ?: config('app.name');
|
||||
|
||||
return "Guten Tag {$booking->guest->first_name} {$booking->guest->last_name},\n\n"
|
||||
."vielen Dank für Ihre Buchung der {$booking->property->name} vom {$booking->arrival->format('d.m.Y')} bis {$booking->departure->format('d.m.Y')}. "
|
||||
."Für den Mietvertrag benötigen wir noch Ihre Kontaktdaten: vollständige Anschrift (Straße, PLZ, Ort), eine E-Mail-Adresse und eine Telefonnummer.\n\n"
|
||||
."Sobald wir die Angaben haben, senden wir Ihnen den Vertrag mit allen Informationen zu.\n\n"
|
||||
."Freundliche Grüße\n{$landlord}";
|
||||
}
|
||||
|
||||
/**
|
||||
* Form data of the offer modal as SendOffer changes (euro input → cents).
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user