Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m59s
Eine Zusammenstellung vor jedem Dokument (Angebot, Bestaetigung, Buchungsunterlagen extern), Dokumentart je Vorgangsart, Freigaben fuer Vorlagen und Dokumentarten, Schutz vor unvereinbarten Bedingungen bei Portalbuchungen (E-004), kein doppelter Versand, Absicherung Hold 0 bis Paket 7, A6-Aufenthaltsbestaetigung vorbereitet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
2.0 KiB
PHP
44 lines
2.0 KiB
PHP
<?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('released')->label('Freigegeben')->boolean()->state(fn (ContractTemplate $record): bool => $record->isReleased()),
|
|
IconColumn::make('portal_terms')->label('Portalbedingungen')->boolean()->state(fn (ContractTemplate $record): bool => $record->confirmsPortalTerms()),
|
|
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(),
|
|
]);
|
|
}
|
|
}
|