Stornoregeln mit automatischer Kostenberechnung, Storno-Verwaltung, Vertragsanlagen
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m34s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m34s
- Stornoregel (Stufen nach Tagen vor Anreise, Mietpreis oder Gesamtpreis, Ersatzmieter-Gebuehr), je Vertragsvorlage, beim Angebot eingefroren, als Platzhalter im Vertrag - Stornierung (Gast-Link oder Verwaltung) berechnet die Kosten, legt einen Stornofall an; Verwaltung Stornierungen mit Vorschlag, Festlegung, Saldo, Abrechnung und Erlass; Gast sieht die Kosten vorab auf der Storno-Seite - Vertragsanlagen als eigene versionierte Dokumente mit Bedingung (immer, Zusatzleistung, Portal, von Hand), je Angebot ausgewaehlt und eingefroren; Zusatzleistungen in der Buchung erfassbar - FeWo-direkt-Installation legt die Stornoregel aus Paragraf 13 an Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5baf39441f
commit
0c4187edaf
37 files changed
+1440
-10
No files matched your search
@@ -6,13 +6,16 @@
|
||||
use App\Actions\ConfirmBooking;
|
||||
use App\Actions\DeclineBooking;
|
||||
use App\Actions\SendOffer;
|
||||
use App\Documents\OfferTerms;
|
||||
use App\Documents\RentalContract;
|
||||
use App\Enums\BookingStatus;
|
||||
use App\Exceptions\ReservationException;
|
||||
use App\Filament\Actions\AssignGuestAction;
|
||||
use App\Filament\Resources\Bookings\BookingResource;
|
||||
use App\Models\Booking;
|
||||
use App\Models\ContractAnnex;
|
||||
use App\Models\ContractTemplate;
|
||||
use App\Models\Extra;
|
||||
use App\Pricing\PriceCalculator;
|
||||
use App\Pricing\QuoteException;
|
||||
use App\Pricing\StayRequest;
|
||||
@@ -22,6 +25,7 @@
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
@@ -88,7 +92,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([
|
||||
Section::make('Vertragsvorlage und Anlagen')->schema([
|
||||
Select::make('annex_ids')
|
||||
->label('Anlagen')
|
||||
->multiple()
|
||||
->options(fn (): array => ContractAnnex::query()->orderBy('name')->orderBy('version')->get()->mapWithKeys(fn (ContractAnnex $annex): array => [$annex->id => $annex->label()])->all())
|
||||
->default(fn (): array => OfferTerms::templateFor($this->record)?->annexesFor($this->record)->pluck('id')->all() ?? [])
|
||||
->helperText('Vorausgewählt: Anlagen der Vorlage, deren Bedingung zu dieser Buchung passt (z. B. gebuchtes Wäschepaket). Sie können Anlagen hinzufügen oder entfernen.'),
|
||||
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())
|
||||
@@ -190,6 +200,31 @@ protected function getHeaderActions(): array
|
||||
$notification = Notification::make()->title($sent ? 'Bestätigung gesendet' : 'Versand fehlgeschlagen');
|
||||
($sent ? $notification->success() : $notification->danger()->body('Details im Postfach.'))->send();
|
||||
}),
|
||||
Action::make('services')
|
||||
->label('Zusatzleistungen erfassen')
|
||||
->icon(Heroicon::OutlinedPlusCircle)
|
||||
->color('gray')
|
||||
->visible(fn (): bool => ! in_array($this->record->status, [BookingStatus::Cancelled, BookingStatus::Declined, BookingStatus::Expired, BookingStatus::Completed], true))
|
||||
->modalDescription('Gebuchte Zusatzleistungen (kostenpflichtig oder kostenlos), z. B. aus einer Portalbuchung oder per E-Mail erfragt. Sie bestimmen, welche Vertragsanlagen angehängt werden. Der Preis der Buchung wird dadurch nicht verändert.')
|
||||
->fillForm(fn (): array => ['items' => collect((array) $this->record->extras)->map(fn ($quantity, $id): array => ['extra_id' => (int) $id, 'quantity' => (int) $quantity])->values()->all()])
|
||||
->schema([
|
||||
Repeater::make('items')
|
||||
->label('Leistungen')
|
||||
->schema([
|
||||
Select::make('extra_id')->label('Leistung')->options(fn (): array => Extra::query()->orderBy('name')->get()->mapWithKeys(fn (Extra $extra): array => [$extra->id => $extra->name.($extra->price > 0 ? ' ('.Money::format($extra->price).')' : ' (kostenlos)')])->all())->required(),
|
||||
TextInput::make('quantity')->label('Menge')->integer()->minValue(1)->default(1)->required(),
|
||||
])
|
||||
->columns(2)
|
||||
->addActionLabel('Leistung hinzufügen'),
|
||||
])
|
||||
->action(function (array $data): void {
|
||||
$extras = [];
|
||||
foreach ((array) ($data['items'] ?? []) as $item) {
|
||||
$extras[(int) $item['extra_id']] = ((int) ($extras[(int) $item['extra_id']] ?? 0)) + max(1, (int) $item['quantity']);
|
||||
}
|
||||
$this->record->update(['extras' => $extras]);
|
||||
Notification::make()->title('Zusatzleistungen gespeichert')->success()->send();
|
||||
}),
|
||||
Action::make('contractText')
|
||||
->label('Vertragstext ansehen')
|
||||
->icon(Heroicon::OutlinedDocumentMagnifyingGlass)
|
||||
|
||||
Reference in new issue
Block a user