Dokumentenzusammenstellung und Vorlagensteuerung (Paket 3, Prozessarchitektur v0.10)
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m59s
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>
This commit is contained in:
1 parent
64248c09fa
commit
cf11c8a474
45 files changed
+2385
-144
No files matched your search
@@ -3,7 +3,9 @@
|
||||
namespace App\Filament\Resources\ContractTemplates\Pages;
|
||||
|
||||
use App\Filament\Resources\ContractTemplates\ContractTemplateResource;
|
||||
use App\Models\ContractTemplate;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CreateContractTemplate extends CreateRecord
|
||||
{
|
||||
@@ -21,4 +23,16 @@ protected function mutateFormDataBeforeCreate(array $data): array
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
protected function handleRecordCreation(array $data): Model
|
||||
{
|
||||
$template = new ContractTemplate(collect($data)->except(['is_released', 'is_portal_terms'])->all());
|
||||
$template->applyStatements((bool) ($data['is_released'] ?? false), (bool) ($data['is_portal_terms'] ?? false), (string) auth()->user()?->name);
|
||||
$template->save();
|
||||
|
||||
return $template;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,10 @@
|
||||
namespace App\Filament\Resources\ContractTemplates\Pages;
|
||||
|
||||
use App\Filament\Resources\ContractTemplates\ContractTemplateResource;
|
||||
use App\Models\ContractTemplate;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EditContractTemplate extends EditRecord
|
||||
{
|
||||
@@ -14,4 +16,26 @@ protected function getHeaderActions(): array
|
||||
{
|
||||
return [DeleteAction::make()];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function mutateFormDataBeforeFill(array $data): array
|
||||
{
|
||||
return [...$data, 'is_released' => $data['released_at'] !== null, 'is_portal_terms' => $data['portal_terms_confirmed_at'] !== null];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
protected function handleRecordUpdate(Model $record, array $data): Model
|
||||
{
|
||||
/** @var ContractTemplate $record */
|
||||
$record->fill(collect($data)->except(['is_released', 'is_portal_terms'])->all());
|
||||
$record->applyStatements((bool) ($data['is_released'] ?? false), (bool) ($data['is_portal_terms'] ?? false), (string) auth()->user()?->name);
|
||||
$record->save();
|
||||
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Components\Text;
|
||||
use Filament\Schemas\Schema;
|
||||
@@ -65,6 +66,17 @@ public static function configure(Schema $schema): Schema
|
||||
Textarea::make('texts.closing')->label('Vertragsschluss')->rows(3)->columnSpanFull(),
|
||||
Textarea::make('texts.contract_note')->label('Hinweis im Angebots-PDF')->rows(3)->columnSpanFull(),
|
||||
]),
|
||||
Section::make('Freigabe')
|
||||
->description('Ihre Erklärung zu genau diesem Text. Ändert sich der Text, gilt sie erst nach erneutem Speichern mit Haken wieder; eine neue Version beginnt ohne Freigabe.')
|
||||
->columnSpanFull()
|
||||
->schema([
|
||||
Toggle::make('is_released')
|
||||
->label('Für den Versand an Gäste freigegeben')
|
||||
->helperText('Ohne Freigabe wird die Vorlage nie automatisch versendet; von Hand nur nach ausdrücklicher Bestätigung im Vorgang.'),
|
||||
Toggle::make('is_portal_terms')
|
||||
->label('Gibt nur wieder, was Gäste bei der Buchung über das Portal akzeptieren')
|
||||
->helperText('Nur für Vorlagen, die bei beim Portal gebuchten Vorgängen verwendet werden. Ohne diesen Haken weist der Vorgang auf Gebühren und Bedingungen der Vorlage hin und verlangt vor dem Versand eine Bestätigung.'),
|
||||
]),
|
||||
Textarea::make('notes')->label('Interne Notiz')->rows(2)->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ public static function configure(Table $table): Table
|
||||
->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'),
|
||||
])
|
||||
|
||||
Reference in new issue
Block a user