Zahlungsaufgaben, Freigabe-/Storno-Link, Vertragsvorlagen, Anreise-Mail
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m36s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m36s
- Zahlungen werden nicht mehr automatisch angemahnt: faellige Anzahlung/Restzahlung werden Aufgaben (Zahlungen & Wuensche, Tages-/Wochenuebersicht); Mail nur per Klick; je Portal und Buchungstyp abschaltbar - Freigabe-Link in der Eingangsbestaetigung, Storno-Link in der Buchungsbestaetigung; je Wohnung Wunsch / sofort / sofort bis Frist; Stornowuensche und Kosten bleiben Aufgabe des Gastgebers - Vertragsvorlagen mit Versionen (je Angebot, Portal oder Wohnung waehlbar), benutzte Versionen gesperrt; Angebot und finaler Vertrag als unveraenderliche PDF mit SHA-256, Vertrag wird nie neu geschrieben - Anreise-Mail je Wohnung einstellbar (Standard 3 Tage), neue Textfelder Schluessel/Parken/Ankunftstag Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eafab8a2cb
commit
a73b164ea1
51 files changed
+1807
-52
No files matched your search
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BookingTasks;
|
||||
|
||||
use App\Filament\Concerns\FollowsAdminMode;
|
||||
use App\Filament\Resources\BookingTasks\Pages\ListBookingTasks;
|
||||
use App\Filament\Resources\BookingTasks\Tables\BookingTasksTable;
|
||||
use App\Models\BookingTask;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class BookingTaskResource extends Resource
|
||||
{
|
||||
use FollowsAdminMode;
|
||||
|
||||
protected static ?string $model = BookingTask::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBanknotes;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Vermietung';
|
||||
|
||||
protected static ?string $modelLabel = 'Buchungsaufgabe';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Zahlungen & Wünsche';
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return BookingTasksTable::configure($table);
|
||||
}
|
||||
|
||||
public static function canCreate(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getNavigationBadge(): ?string
|
||||
{
|
||||
$open = BookingTask::query()->open()->count();
|
||||
|
||||
return $open > 0 ? (string) $open : null;
|
||||
}
|
||||
|
||||
public static function getNavigationBadgeColor(): string
|
||||
{
|
||||
return 'warning';
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListBookingTasks::route('/'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BookingTasks\Pages;
|
||||
|
||||
use App\Filament\Concerns\ListsCurrentProperty;
|
||||
use App\Filament\Resources\BookingTasks\BookingTaskResource;
|
||||
use App\Models\Property;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class ListBookingTasks extends ListRecords
|
||||
{
|
||||
use ListsCurrentProperty;
|
||||
|
||||
protected static string $resource = BookingTaskResource::class;
|
||||
|
||||
protected function scopeToProperty(Builder $query, Property $property): Builder
|
||||
{
|
||||
return $query->whereHas('booking', fn (Builder $booking) => $booking->where('property_id', $property->id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BookingTasks\Tables;
|
||||
|
||||
use App\Actions\SendPaymentReminder;
|
||||
use App\Enums\BookingTaskStatus;
|
||||
use App\Exceptions\ReservationException;
|
||||
use App\Filament\Resources\Bookings\BookingResource;
|
||||
use App\Models\BookingTask;
|
||||
use App\Support\Money;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Throwable;
|
||||
|
||||
class BookingTasksTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->defaultSort('created_at', 'desc')
|
||||
->description('Fällige Zahlungen und Wünsche von Gästen. Es wird nichts automatisch an Gäste gesendet: Bitte erst den Zahlungseingang prüfen, dann die Erinnerung per Klick senden oder die Aufgabe abhaken.')
|
||||
->columns([
|
||||
TextColumn::make('booking.reference')->label('Buchung')->weight('medium')->description(fn (BookingTask $record): string => $record->booking->guest?->full_name ?? ''),
|
||||
TextColumn::make('kind')->label('Aufgabe')->badge(),
|
||||
TextColumn::make('due_on')->label('Fällig seit')->date('d.m.Y')->placeholder('–'),
|
||||
TextColumn::make('open')->label('Offen')->state(fn (BookingTask $record): string => Money::format($record->booking->openAmount())),
|
||||
TextColumn::make('status')->label('Status')->badge()
|
||||
->description(fn (BookingTask $record): ?string => $record->completed_by ? "{$record->completed_by}, {$record->completed_at?->format('d.m. H:i')}" : null),
|
||||
TextColumn::make('note')->label('Hinweis')->wrap()->placeholder('–'),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('status')->label('Status')->options(BookingTaskStatus::class)->default(BookingTaskStatus::Open->value),
|
||||
])
|
||||
->recordActions([
|
||||
Action::make('booking')
|
||||
->label('Buchung')
|
||||
->icon(Heroicon::OutlinedArrowTopRightOnSquare)
|
||||
->color('gray')
|
||||
->url(fn (BookingTask $record): string => BookingResource::getUrl('view', ['record' => $record->booking])),
|
||||
Action::make('send')
|
||||
->label('Mail an Gast senden')
|
||||
->icon(Heroicon::OutlinedEnvelope)
|
||||
->requiresConfirmation()
|
||||
->modalDescription('Haben Sie den Zahlungseingang geprüft? Der Gast erhält die Zahlungs-E-Mail sofort.')
|
||||
->visible(fn (BookingTask $record): bool => $record->status === BookingTaskStatus::Open && $record->kind->reminder() !== null)
|
||||
->action(function (BookingTask $record, SendPaymentReminder $send): void {
|
||||
try {
|
||||
$send->handle($record, auth()->user()->name);
|
||||
} catch (ReservationException $exception) {
|
||||
Notification::make()->title('Nicht möglich')->body($exception->getMessage())->danger()->send();
|
||||
|
||||
return;
|
||||
} catch (Throwable) {
|
||||
Notification::make()->title('E-Mail konnte nicht gesendet werden')->body('Die Aufgabe bleibt offen.')->danger()->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Notification::make()->title('E-Mail gesendet')->success()->send();
|
||||
}),
|
||||
Action::make('done')
|
||||
->label('Erledigt')
|
||||
->icon(Heroicon::OutlinedCheck)
|
||||
->color('success')
|
||||
->visible(fn (BookingTask $record): bool => $record->status === BookingTaskStatus::Open)
|
||||
->action(fn (BookingTask $record) => $record->complete(auth()->user()->name)),
|
||||
Action::make('dismiss')
|
||||
->label('Verwerfen')
|
||||
->icon(Heroicon::OutlinedXMark)
|
||||
->color('gray')
|
||||
->requiresConfirmation()
|
||||
->visible(fn (BookingTask $record): bool => $record->status === BookingTaskStatus::Open)
|
||||
->action(fn (BookingTask $record) => $record->update(['status' => BookingTaskStatus::Dismissed])),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
use App\Filament\Actions\AssignGuestAction;
|
||||
use App\Filament\Resources\Bookings\BookingResource;
|
||||
use App\Models\Booking;
|
||||
use App\Models\ContractTemplate;
|
||||
use App\Pricing\PriceCalculator;
|
||||
use App\Pricing\QuoteException;
|
||||
use App\Pricing\StayRequest;
|
||||
@@ -20,6 +21,7 @@
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
@@ -85,6 +87,13 @@ protected function getHeaderActions(): array
|
||||
TextInput::make('price_adjustment_label')->label('Bezeichnung')->placeholder('Nachlass / Zuschlag')->maxLength(80),
|
||||
Text::make(fn (Get $get): string => $this->offerPricePreview($get))->columnSpanFull(),
|
||||
]),
|
||||
Section::make('Vertragsvorlage')->schema([
|
||||
Select::make('contract_template_id')
|
||||
->label('Vorlage für dieses Angebot')
|
||||
->options(fn (): array => ContractTemplate::query()->orderBy('name')->orderBy('version')->get()->mapWithKeys(fn (ContractTemplate $template): array => [$template->id => $template->label()])->all())
|
||||
->placeholder('Standard (Portal / Wohnung / Webseite)')
|
||||
->helperText('Die Texte werden beim Versand fest im Angebot abgelegt.'),
|
||||
]),
|
||||
Section::make('Gültigkeit & Nachricht')->columns(2)->schema([
|
||||
DateTimePicker::make('valid_until')
|
||||
->label('Angebot gültig bis')
|
||||
@@ -187,16 +196,6 @@ protected function getHeaderActions(): array
|
||||
->visible(fn (): bool => $this->record->contract_path !== null)
|
||||
->action(fn (RentalContract $contract) => response()->download($contract->absolutePath($this->record) ?? abort(404), "Mietvertrag-{$this->record->reference}.pdf")),
|
||||
ActionGroup::make([
|
||||
Action::make('regenerateContract')
|
||||
->label('Mietvertrag neu erzeugen')
|
||||
->icon(Heroicon::OutlinedArrowPath)
|
||||
->visible(fn (): bool => in_array($this->record->status, [...BookingStatus::occupying()], true))
|
||||
->requiresConfirmation()
|
||||
->modalDescription('Der Vertrag wird mit den Bedingungen des angenommenen Angebots neu erstellt. Der Gast erhält ihn nicht automatisch.')
|
||||
->action(function (RentalContract $contract): void {
|
||||
$contract->generate($this->record);
|
||||
Notification::make()->title('Mietvertrag neu erzeugt')->success()->send();
|
||||
}),
|
||||
Action::make('notes')
|
||||
->label('Interne Notiz bearbeiten')
|
||||
->icon(Heroicon::OutlinedPencilSquare)
|
||||
|
||||
@@ -74,7 +74,7 @@ public static function configure(Schema $schema): Schema
|
||||
->visible(fn (Booking $record): bool => $record->isDirect()),
|
||||
TextEntry::make('offer')
|
||||
->label('Angebot')
|
||||
->state(fn (Booking $record): string => 'Version '.$record->offer_version.', gesendet '.$record->offer_sent_at?->format('d.m.Y, H:i').' · Prüfsumme '.substr((string) $record->offer_hash, 0, 12))
|
||||
->state(fn (Booking $record): string => 'Version '.$record->offer_version.', gesendet '.$record->offer_sent_at?->format('d.m.Y, H:i').' · Prüfsumme '.substr((string) $record->offer_hash, 0, 12).(isset($record->offer_terms['template']) ? ' · Vorlage '.$record->offer_terms['template']['name'].' v'.$record->offer_terms['template']['version'] : ''))
|
||||
->visible(fn (Booking $record): bool => $record->offer_version > 0),
|
||||
TextEntry::make('accepted_at')->label('Angenommen am')->dateTime('d.m.Y, H:i:s')->visible(fn (Booking $record): bool => $record->accepted_at !== null),
|
||||
TextEntry::make('confirmation')
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
use App\Enums\ChannelExportMode;
|
||||
use App\Enums\ChannelStatus;
|
||||
use App\Models\Channel;
|
||||
use App\Models\ContractTemplate;
|
||||
use App\Models\Property;
|
||||
use App\Support\CurrentProperty;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
@@ -49,7 +50,20 @@ public static function configure(Schema $schema, bool $selectProperty = false):
|
||||
->maxLength(100),
|
||||
Select::make('status')->label('Kanalstatus')->options(ChannelStatus::class)->default(ChannelStatus::Setup)->required(),
|
||||
Select::make('booking_model')->label('Buchungsmodell')->options(ChannelBookingModel::class)->default(ChannelBookingModel::Mixed)->required()
|
||||
->helperText('Fachliche Einordnung; löst keine automatischen Buchungsentscheidungen aus.'),
|
||||
->helperText('„Portalbuchung“ und „Gemischt“ gelten als Sofortbuchung: automatische Angebote für diese Wohnung warten, bis das Portal unseren Kalender abgerufen hat. „Vermittlung / Anfrage“: keine Sofortbuchung.'),
|
||||
Select::make('contract_template_id')
|
||||
->label('Vertragsvorlage für dieses Portal')
|
||||
->options(fn (): array => ContractTemplate::query()->orderBy('name')->orderBy('version')->get()->mapWithKeys(fn (ContractTemplate $template): array => [$template->id => $template->label()])->all())
|
||||
->placeholder('Standard der Wohnung')
|
||||
->helperText('Für Angebote zu Buchungen, die über dieses Portal kommen und dessen Vorgaben (z. B. Stornofristen) entsprechen müssen.'),
|
||||
Toggle::make('payment_tasks_inquiry')
|
||||
->label('Zahlungsaufgaben bei Anfragen über dieses Portal')
|
||||
->helperText('Fällige Anzahlungen/Restzahlungen erscheinen als Aufgabe (Mails an Gäste gehen nie automatisch).')
|
||||
->default(true),
|
||||
Toggle::make('payment_tasks_reservation')
|
||||
->label('Zahlungsaufgaben bei Reservierungen über dieses Portal')
|
||||
->helperText('Aus, wenn das Portal das Geld einzieht und mahnt (z. B. FeWo-direkt Online-Buchung).')
|
||||
->default(false),
|
||||
Select::make('connector')
|
||||
->label('Kalenderanbindung')
|
||||
->helperText('Diese Verbindung gleicht Belegungszeiträume über iCal ab. Weitere Portalfunktionen benötigen eine eigene Anbindung.')
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ContractTemplates;
|
||||
|
||||
use App\Filament\Concerns\FollowsAdminMode;
|
||||
use App\Filament\Resources\ContractTemplates\Pages\CreateContractTemplate;
|
||||
use App\Filament\Resources\ContractTemplates\Pages\EditContractTemplate;
|
||||
use App\Filament\Resources\ContractTemplates\Pages\ListContractTemplates;
|
||||
use App\Filament\Resources\ContractTemplates\Schemas\ContractTemplateForm;
|
||||
use App\Filament\Resources\ContractTemplates\Tables\ContractTemplatesTable;
|
||||
use App\Models\ContractTemplate;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use UnitEnum;
|
||||
|
||||
class ContractTemplateResource extends Resource
|
||||
{
|
||||
use FollowsAdminMode;
|
||||
|
||||
protected static ?string $model = ContractTemplate::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedDocumentDuplicate;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Vermietung';
|
||||
|
||||
protected static ?string $modelLabel = 'Vertragsvorlage';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Vertragsvorlagen';
|
||||
|
||||
protected static ?int $navigationSort = 6;
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return ContractTemplateForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return ContractTemplatesTable::configure($table);
|
||||
}
|
||||
|
||||
/**
|
||||
* A version used in an offer is a document of record and is never edited; a new version is made instead.
|
||||
*/
|
||||
public static function canEdit(Model $record): bool
|
||||
{
|
||||
return ! $record->isUsed();
|
||||
}
|
||||
|
||||
public static function canDelete(Model $record): bool
|
||||
{
|
||||
return ! $record->isUsed();
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListContractTemplates::route('/'),
|
||||
'create' => CreateContractTemplate::route('/create'),
|
||||
'edit' => EditContractTemplate::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ContractTemplates\Pages;
|
||||
|
||||
use App\Filament\Resources\ContractTemplates\ContractTemplateResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateContractTemplate extends CreateRecord
|
||||
{
|
||||
protected static string $resource = ContractTemplateResource::class;
|
||||
|
||||
/**
|
||||
* A new template starts with version 1; further versions are made from an existing one.
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function mutateFormDataBeforeCreate(array $data): array
|
||||
{
|
||||
$data['version'] = 1;
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ContractTemplates\Pages;
|
||||
|
||||
use App\Filament\Resources\ContractTemplates\ContractTemplateResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditContractTemplate extends EditRecord
|
||||
{
|
||||
protected static string $resource = ContractTemplateResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [DeleteAction::make()];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ContractTemplates\Pages;
|
||||
|
||||
use App\Filament\Resources\ContractTemplates\ContractTemplateResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListContractTemplates extends ListRecords
|
||||
{
|
||||
protected static string $resource = ContractTemplateResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [CreateAction::make()];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ContractTemplates\Schemas;
|
||||
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class ContractTemplateForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
$editor = fn (string $field, string $label): RichEditor => RichEditor::make("texts.{$field}")
|
||||
->label($label)
|
||||
->toolbarButtons([['bold', 'italic', 'link'], ['bulletList', 'orderedList']])
|
||||
->columnSpanFull();
|
||||
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('name')->label('Name der Vorlage')->required()->maxLength(120)
|
||||
->helperText('z. B. „Direktbuchung“ oder „Portal XY“. Versionen derselben Vorlage haben denselben Namen.'),
|
||||
TextInput::make('version')->label('Version')->integer()->default(1)->disabled()->dehydrated(false)
|
||||
->helperText('Neue Versionen entstehen über „Neue Version“ in der Liste. Eine Vorlage, die in einem Angebot verwendet wurde, kann nicht mehr geändert werden.'),
|
||||
Section::make('Texte dieser Vorlage')
|
||||
->description('Nur ausgefüllte Felder ersetzen die Texte der Webseite (Texte › Aufenthalt / Vertrag); leere Felder übernehmen den Webseitentext. Beim Versand des Angebots wird eine Kopie fest abgelegt.')
|
||||
->columnSpanFull()
|
||||
->schema([
|
||||
$editor('terms', 'Mietbedingungen'),
|
||||
$editor('cancellation', 'Rücktritt / Stornierung'),
|
||||
$editor('house_rules', 'Hausordnung'),
|
||||
Textarea::make('texts.intro')->label('Vertragseinleitung')->rows(3)->columnSpanFull(),
|
||||
Textarea::make('texts.closing')->label('Vertragsschluss')->rows(3)->columnSpanFull(),
|
||||
Textarea::make('texts.contract_note')->label('Hinweis im Angebots-PDF')->rows(3)->columnSpanFull(),
|
||||
]),
|
||||
Textarea::make('notes')->label('Interne Notiz')->rows(2)->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ContractTemplates\Tables;
|
||||
|
||||
use App\Models\ContractTemplate;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class ContractTemplatesTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->defaultSort('name')
|
||||
->columns([
|
||||
TextColumn::make('name')->label('Vorlage')->searchable()->weight('medium'),
|
||||
TextColumn::make('version')->label('Version')->badge(),
|
||||
IconColumn::make('used')->label('In Angeboten verwendet')->boolean()->state(fn (ContractTemplate $record): bool => $record->isUsed()),
|
||||
TextColumn::make('updated_at')->label('Geändert')->dateTime('d.m.Y, H:i'),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
Action::make('newVersion')
|
||||
->label('Neue Version')
|
||||
->icon(Heroicon::OutlinedDocumentDuplicate)
|
||||
->requiresConfirmation()
|
||||
->modalDescription('Es wird eine Kopie mit der nächsten Versionsnummer angelegt, die Sie dann bearbeiten können. Die bisherige Version bleibt unverändert.')
|
||||
->action(function (ContractTemplate $record): void {
|
||||
$copy = $record->newVersion();
|
||||
Notification::make()->title('Version '.$copy->version.' angelegt')->success()->send();
|
||||
}),
|
||||
DeleteAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
namespace App\Filament\Resources\Properties\Schemas;
|
||||
|
||||
use App\Enums\CancellationMode;
|
||||
use App\Enums\OfferMode;
|
||||
use App\Filament\Forms\Components\EuroInput;
|
||||
use App\ImageWorlds\ImageWorldRegistry;
|
||||
use App\Models\ContractTemplate;
|
||||
use App\Models\Site;
|
||||
use Closure;
|
||||
use Filament\Forms\Components\Select;
|
||||
@@ -116,6 +118,34 @@ public static function configure(Schema $schema): Schema
|
||||
->minValue(1)
|
||||
->suffix('Stunden')
|
||||
->default(48),
|
||||
Select::make('cancellation_mode')
|
||||
->label('Stornierungslink in der Buchungsbestätigung')
|
||||
->options(CancellationMode::class)
|
||||
->default(CancellationMode::Request)
|
||||
->required()
|
||||
->live()
|
||||
->helperText('Bei Sofort-Stornierung wird der Zeitraum frei; Kosten und Rückzahlung bleiben immer Ihre Aufgabe.'),
|
||||
TextInput::make('free_cancellation_days')
|
||||
->label('Kostenfrei stornierbar bis')
|
||||
->integer()
|
||||
->minValue(0)
|
||||
->suffix('Tage vor Anreise')
|
||||
->default(14)
|
||||
->visible(fn (Get $get): bool => $get('cancellation_mode') === CancellationMode::InstantWhenFree->value || $get('cancellation_mode') === CancellationMode::InstantWhenFree),
|
||||
Select::make('contract_template_id')
|
||||
->label('Standard-Vertragsvorlage')
|
||||
->options(fn (): array => ContractTemplate::query()->orderBy('name')->orderBy('version')->get()->mapWithKeys(fn (ContractTemplate $template): array => [$template->id => $template->label()])->all())
|
||||
->placeholder('Texte der Webseite')
|
||||
->helperText('Wird bei neuen Angeboten verwendet, sofern das Portal keine eigene Vorlage hat.'),
|
||||
TextInput::make('arrival_info_days_before')
|
||||
->label('Anreise-E-Mail senden')
|
||||
->helperText('Automatische Mail mit den letzten Hinweisen (Texte unter Texte › Aufenthalt).')
|
||||
->required()
|
||||
->integer()
|
||||
->minValue(1)
|
||||
->maxValue(14)
|
||||
->suffix('Tage vor Anreise')
|
||||
->default(3),
|
||||
Toggle::make('pre_reservation_enabled')
|
||||
->label('Anfrage blockiert den Kalender (Vorreservierung)')
|
||||
->helperText('Aus: eine bloße Anfrage sperrt keinen Zeitraum. Dann ist kein automatisches Angebot möglich.')
|
||||
|
||||
Reference in new issue
Block a user