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>
88 lines
3.1 KiB
PHP
88 lines
3.1 KiB
PHP
<?php
|
||
|
||
namespace App\Filament\Pages;
|
||
|
||
use App\Enums\UserRole;
|
||
use App\Filament\Concerns\FollowsAdminMode;
|
||
use App\Filament\Resources\Properties\Pages\EditProperty;
|
||
use App\Filament\Resources\Properties\RelationManagers\ExtrasRelationManager;
|
||
use App\Filament\Resources\Properties\RelationManagers\SeasonsRelationManager;
|
||
use App\Filament\Resources\Properties\RelationManagers\SpecialOffersRelationManager;
|
||
use App\Models\Property;
|
||
use App\Support\CurrentProperty;
|
||
use BackedEnum;
|
||
use Filament\Pages\Page;
|
||
use Filament\Schemas\Components\Livewire;
|
||
use Filament\Schemas\Components\Tabs;
|
||
use Filament\Schemas\Components\Tabs\Tab;
|
||
use Filament\Schemas\Components\Text;
|
||
use Filament\Schemas\Schema;
|
||
use Filament\Support\Icons\Heroicon;
|
||
use Livewire\Attributes\Url;
|
||
use UnitEnum;
|
||
|
||
/**
|
||
* The yearly price work in one place, without the other apartment settings: seasons & prices,
|
||
* special offers & promo codes, extras. Reuses the relation managers of the apartment.
|
||
*/
|
||
class PricesAndOffers extends Page
|
||
{
|
||
use FollowsAdminMode;
|
||
|
||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCurrencyEuro;
|
||
|
||
protected static string|UnitEnum|null $navigationGroup = 'Einrichtung';
|
||
|
||
protected static ?string $navigationLabel = 'Preise & Angebote';
|
||
|
||
protected static ?string $title = 'Preise & Angebote';
|
||
|
||
protected static ?string $slug = 'preise-und-angebote';
|
||
|
||
protected static ?int $navigationSort = 0;
|
||
|
||
#[Url(as: 'wohnung')]
|
||
public ?int $propertyId = null;
|
||
|
||
public static function canAccess(): bool
|
||
{
|
||
return (bool) auth()->user()?->hasRole(UserRole::Admin, UserRole::Rentals);
|
||
}
|
||
|
||
public function getSubheading(): ?string
|
||
{
|
||
return app(CurrentProperty::class)->hasChoice() ? Property::query()->find($this->propertyId)?->name : null;
|
||
}
|
||
|
||
public function mount(): void
|
||
{
|
||
$this->propertyId = app(CurrentProperty::class)->followUrl($this->propertyId);
|
||
}
|
||
|
||
public function content(Schema $schema): Schema
|
||
{
|
||
$property = Property::find($this->propertyId);
|
||
if ($property === null) {
|
||
return $schema->components([Text::make('Es ist noch keine Wohnung angelegt (Expertenansicht › Wohnungen).')]);
|
||
}
|
||
|
||
$context = ['ownerRecord' => $property, 'pageClass' => EditProperty::class];
|
||
|
||
return $schema->components([
|
||
Tabs::make('prices')
|
||
->persistTabInQueryString()
|
||
->tabs([
|
||
Tab::make('Saisons & Preise')->icon(Heroicon::OutlinedCalendar)->schema([
|
||
Livewire::make(SeasonsRelationManager::class, $context)->key("seasons-{$property->id}"),
|
||
]),
|
||
Tab::make('Sonderangebote & Rabattcodes')->icon(Heroicon::OutlinedSparkles)->schema([
|
||
Livewire::make(SpecialOffersRelationManager::class, $context)->key("offers-{$property->id}"),
|
||
]),
|
||
Tab::make('Extras')->icon(Heroicon::OutlinedGift)->schema([
|
||
Livewire::make(ExtrasRelationManager::class, $context)->key("extras-{$property->id}"),
|
||
]),
|
||
]),
|
||
]);
|
||
}
|
||
}
|