- Zahlungen erfassen (inkl. Erstattungen), Status automatisch: Bestätigt → Anzahlung erhalten → Bezahlt → Abgeschlossen - Anzahlungsfrist bei Bestätigung; kurzfristige Buchungen: Gesamtbetrag sofort - Mietvertrag als PDF (dompdf, Font-Subsetting), bei Bestätigung gespeichert und angehängt; Texte im Admin (Muster) - Täglich: Zahlungserinnerungen (Anzahlung/Rest überfällig, Kopie an Vermieter), Zahlungsaufforderung Rest 7 Tage vorher, Anreiseinfos 7 Tage vorher, Abschluss nach Abreise - Admin: Zahlungen je Buchung, offene Beträge, Vertrag herunterladen/neu erzeugen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
83 lines
2.3 KiB
PHP
83 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Bookings;
|
|
|
|
use App\Enums\BookingStatus;
|
|
use App\Filament\Resources\Bookings\Pages\CreateBooking;
|
|
use App\Filament\Resources\Bookings\Pages\ListBookings;
|
|
use App\Filament\Resources\Bookings\Pages\ViewBooking;
|
|
use App\Filament\Resources\Bookings\RelationManagers\PaymentsRelationManager;
|
|
use App\Filament\Resources\Bookings\Schemas\BookingForm;
|
|
use App\Filament\Resources\Bookings\Schemas\BookingInfolist;
|
|
use App\Filament\Resources\Bookings\Tables\BookingsTable;
|
|
use App\Models\Booking;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use UnitEnum;
|
|
|
|
class BookingResource extends Resource
|
|
{
|
|
protected static ?string $model = Booking::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCalendarDays;
|
|
|
|
protected static string|UnitEnum|null $navigationGroup = 'Vermietung';
|
|
|
|
protected static ?string $modelLabel = 'Buchung';
|
|
|
|
protected static ?string $pluralModelLabel = 'Anfragen & Buchungen';
|
|
|
|
protected static ?string $recordTitleAttribute = 'reference';
|
|
|
|
protected static ?int $navigationSort = 1;
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return BookingForm::configure($schema);
|
|
}
|
|
|
|
public static function infolist(Schema $schema): Schema
|
|
{
|
|
return BookingInfolist::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return BookingsTable::configure($table);
|
|
}
|
|
|
|
/**
|
|
* Number of open requests waiting for a decision.
|
|
*/
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
$open = Booking::query()->where('status', BookingStatus::Reserved)->count();
|
|
|
|
return $open > 0 ? (string) $open : null;
|
|
}
|
|
|
|
public static function getNavigationBadgeColor(): string
|
|
{
|
|
return 'warning';
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
PaymentsRelationManager::class,
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListBookings::route('/'),
|
|
'create' => CreateBooking::route('/create'),
|
|
'view' => ViewBooking::route('/{record}'),
|
|
];
|
|
}
|
|
}
|