From 9eb19cf8fd42776ef0b59e953df368eb655b99e7 Mon Sep 17 00:00:00 2001 From: salam Date: Mon, 20 Oct 2025 16:57:50 +0200 Subject: [PATCH] action evaluation --- .../Validation/GutachtenValidation.php | 4 +- .../Projektes/Pages/EditProjekte.php | 50 +++++----- ...ientierungZuAbschlaegesRelationManager.php | 90 ++++++++++++++--- .../ProjektMethodesRelationManager.php | 96 +++++++++++-------- .../RaeumeallesRelationManager.php | 57 ++++++++++- app/Models/Allgemeinflaechen.php | 2 +- app/Models/OrientierungZuAbschlaege.php | 9 ++ app/Models/ProjektMethode.php | 9 ++ app/Models/Raeumealle.php | 9 ++ bootstrap/cache/routes-v7.php | 42 ++++---- composer.lock | 24 ++--- ...25_09_24_131440_create_projektes_table.php | 3 +- resources/svg/pdf.svg | 34 ++++--- 13 files changed, 297 insertions(+), 132 deletions(-) diff --git a/app/Actions/Validation/GutachtenValidation.php b/app/Actions/Validation/GutachtenValidation.php index 345e2c5..44dfe92 100644 --- a/app/Actions/Validation/GutachtenValidation.php +++ b/app/Actions/Validation/GutachtenValidation.php @@ -140,7 +140,7 @@ class GutachtenValidation } /** - * Raeumealle + * Projekt Methode */ $res = ProjektMethode::where('projekte_id', $record->id)->get(); if (! $res->count()) { @@ -232,6 +232,6 @@ class GutachtenValidation ->body('Die Evaluierung des Projektes war erfolgreich.') ->send(); - Projekte::where('id', $record->id)->update(['evaluation' => 1]); + Projekte::where('id', $record->id)->update(['evaluation_gutachten' => 1]); } } diff --git a/app/Filament/Resources/Projektes/Pages/EditProjekte.php b/app/Filament/Resources/Projektes/Pages/EditProjekte.php index 420d2ee..5e7cc2e 100644 --- a/app/Filament/Resources/Projektes/Pages/EditProjekte.php +++ b/app/Filament/Resources/Projektes/Pages/EditProjekte.php @@ -17,9 +17,12 @@ class EditProjekte extends EditRecord { protected static string $resource = ProjekteResource::class; - #[On('refreshAllgemeinflaechen')] + #[On('refreshAllgemeinflaechen'), On('refreshRaeumealle'), On('refreshMethods'), On('refreshOrientierung')] public function refresh(): void {} + // #[On('refreshRaeumealle')] + // public function refresh(): void {} + protected function getHeaderActions(): array { return [ @@ -63,6 +66,15 @@ class EditProjekte extends EditRecord /** * GUTACHTEN */ + Action::make('evaluate_gutachten') + ->hidden(fn ($record): bool => $record->bezahlt_am && ! $record->evaluation_gutachten ? false : true) + ->color('success') + ->label('Evaluieren') + ->icon('phosphor-eye') + ->action(function ($record): void { + GutachtenValidation::controll($record); + $this->record->refresh(); + }), ActionGroup::make([ Action::make('gutachten') ->disabled(fn ($record): bool => ! $record->pdf_gutachten_status) @@ -71,36 +83,21 @@ class EditProjekte extends EditRecord 1 => 'info', default => 'gray', }) - ->label('3) Herunterladen') - ->icon('phosphor-file-pdf') + ->label('Öffnen') + ->icon('icon-pdf') ->url(fn ($record) => route('standard.download', ['record' => $record, 'mode' => 'file'])) ->openUrlInNewTab(), Action::make('make_gutachten') ->hidden(fn ($record): bool => $record->bezahlt_am ? false : true) - ->color(fn ($record): string => match ($record->evaluation) { + ->color(fn ($record): string => match ($record->evaluation_gutachten) { 1 => 'info', default => 'gray', }) - ->disabled(fn ($record): bool => $record->evaluation ? false : true) - ->label('2) Generieren') - ->icon('phosphor-math-operations') + ->disabled(fn ($record): bool => $record->evaluation_gutachten ? false : true) + ->label('Berechnen') + ->icon('phosphor-calculator') ->url(fn ($record) => route('standard.download', ['record' => $record, 'mode' => 'new'])) ->openUrlInNewTab(), - Action::make('evaluate_gutachten') - ->hidden(fn ($record): bool => $record->bezahlt_am ? false : true) - ->color(fn ($record): string => match ($record->evaluation) { - 1 => 'success', - default => 'primary', - }) - ->label('1) Evaluieren') - ->icon(fn ($record): string => match ($record->evaluation) { - 1 => 'phosphor-check', - default => 'phosphor-eye', - }) - ->action(function ($record): void { - GutachtenValidation::controll($record); - $this->record->refresh(); - }), ])->label('Gutachten') ->icon('heroicon-m-ellipsis-vertical') ->button() @@ -116,13 +113,14 @@ class EditProjekte extends EditRecord 1 => 'info', default => 'gray', }) - ->label('Herunterladen') - ->icon('phosphor-file-pdf') + ->label('Öffnen') + ->icon('icon-pdf') ->url(fn ($record) => route('nutzwerte.download', ['record' => $record, 'mode' => 'file'])) ->openUrlInNewTab(), Action::make('make_nutzwerte') ->hidden(fn ($record): bool => $record->bezahlt_am ? false : true) - ->label('Neu Berechnen') + ->disabled(fn ($record): bool => $record->evaluation_gutachten ? false : true) + ->label('Berechnen') ->icon('phosphor-calculator') ->url(fn ($record) => route('nutzwerte.download', ['record' => $record, 'mode' => 'new'])) ->openUrlInNewTab(), @@ -136,12 +134,14 @@ class EditProjekte extends EditRecord ActionGroup::make([ Action::make('excel-nutzflaeche-nutzwerte') ->hidden(fn ($record): bool => $record->bezahlt_am ? false : true) + ->disabled(fn ($record): bool => $record->evaluation_gutachten ? false : true) ->label('Nutzfläche & Nutzwerte') ->icon('icon-excel') ->url(fn ($record) => route('excel.download', ['record' => $record, 'mode' => 'file'])) ->openUrlInNewTab(), Action::make('excel-nutzflaechen-aufstellung') ->hidden(fn ($record): bool => $record->bezahlt_am ? false : true) + ->disabled(fn ($record): bool => $record->evaluation_gutachten ? false : true) ->label('Nutzflächen Aufstellung') ->icon('icon-excel') ->url(fn ($record) => route('excel.download', ['record' => $record, 'mode' => 'file'])) diff --git a/app/Filament/Resources/Projektes/RelationManagers/OrientierungZuAbschlaegesRelationManager.php b/app/Filament/Resources/Projektes/RelationManagers/OrientierungZuAbschlaegesRelationManager.php index 8c9bcb9..34f0e40 100644 --- a/app/Filament/Resources/Projektes/RelationManagers/OrientierungZuAbschlaegesRelationManager.php +++ b/app/Filament/Resources/Projektes/RelationManagers/OrientierungZuAbschlaegesRelationManager.php @@ -22,6 +22,7 @@ use Filament\Tables\Columns\TextInputColumn; use Filament\Tables\Filters\TernaryFilter; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Collection; +use Livewire\Component; class OrientierungZuAbschlaegesRelationManager extends RelationManager { @@ -58,7 +59,10 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ]), CheckboxColumn::make('nicht_in_orientierung') ->label('Nicht in Orientierung') - ->toggleable(), + ->toggleable() + ->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), TextColumn::make('raumart') ->toggleable() ->width('2rem') @@ -71,17 +75,40 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ->selectablePlaceholder(true) ->options(Orientierung::pluck('name', 'id')) ->disableOptionWhen(fn (string $value): bool => in_array($value, [2, 11, 24, 33, 36])) - ->preloadOptions(), - TextInputColumn::make('a')->label($spalten['a'] ?? '')->hidden(isset($spalten['a']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), - TextInputColumn::make('b')->label($spalten['b'] ?? '')->hidden(isset($spalten['b']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), - TextInputColumn::make('c')->label($spalten['c'] ?? '')->hidden(isset($spalten['c']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), - TextInputColumn::make('d')->label($spalten['d'] ?? '')->hidden(isset($spalten['d']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), - TextInputColumn::make('e')->label($spalten['e'] ?? '')->hidden(isset($spalten['e']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), - TextInputColumn::make('f')->label($spalten['f'] ?? '')->hidden(isset($spalten['f']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), - TextInputColumn::make('g')->label($spalten['g'] ?? '')->hidden(isset($spalten['g']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), - TextInputColumn::make('h')->label($spalten['h'] ?? '')->hidden(isset($spalten['h']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), - TextInputColumn::make('i')->label($spalten['i'] ?? '')->hidden(isset($spalten['i']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), - TextInputColumn::make('j')->label($spalten['j'] ?? '')->hidden(isset($spalten['j']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter(), + ->preloadOptions()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('a')->label($spalten['a'] ?? '')->hidden(isset($spalten['a']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter() + ->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('b')->label($spalten['b'] ?? '')->hidden(isset($spalten['b']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('c')->label($spalten['c'] ?? '')->hidden(isset($spalten['c']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('d')->label($spalten['d'] ?? '')->hidden(isset($spalten['d']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('e')->label($spalten['e'] ?? '')->hidden(isset($spalten['e']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('f')->label($spalten['f'] ?? '')->hidden(isset($spalten['f']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('g')->label($spalten['g'] ?? '')->hidden(isset($spalten['g']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('h')->label($spalten['h'] ?? '')->hidden(isset($spalten['h']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('i')->label($spalten['i'] ?? '')->hidden(isset($spalten['i']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), + TextInputColumn::make('j')->label($spalten['j'] ?? '')->hidden(isset($spalten['j']) ? false : true)->toggleable()->rules(['numeric'])->alignCenter()->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), TextColumn::make('nutzwert') ->extraHeaderAttributes([ 'style' => 'position: sticky; right: 0; z-index: 1;', @@ -108,7 +135,10 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ->modalHeading('Merkmale') ->slideOver() // ->modalWidth(Width::Medium) - ->modalContent(view('filament.pages.actions.merkmale')), + ->modalContent(view('filament.pages.actions.merkmale')) + ->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), Action::make('erstellen') ->action(fn (CreateOrientierungZuAbschlaege $createOrientierungZuAbschlaege) => $createOrientierungZuAbschlaege->create($this->ownerRecord)) ->requiresConfirmation() @@ -117,7 +147,10 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ->modalSubmitActionLabel('Erstellen') ->label('Erstellen') ->tooltip('Daten werden aus "Orientierung Zu/Abschläge" Tabelle gefiltert.') - ->icon('heroicon-o-cog-8-tooth'), + ->icon('heroicon-o-cog-8-tooth') + ->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); + }), ]) ->toolbarActions([ BulkActionGroup::make([ @@ -136,6 +169,9 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['raumart' => $data['raumart']] ); } + }) + ->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('methode') ->color('primary') @@ -156,6 +192,9 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['orientierung_id' => $data['methode_id']] ); } + }) + ->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('nicht_in_orientierung') ->color('primary') @@ -177,6 +216,9 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['nicht_in_orientierung' => 1] ); } + }) + ->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('a') ->label($spalten['a'] ?? '') @@ -194,6 +236,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['a' => $data['a']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('b') ->label($spalten['b'] ?? '') @@ -211,6 +255,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['b' => $data['b']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('c') ->label($spalten['c'] ?? '') @@ -228,6 +274,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['c' => $data['c']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('d') ->label($spalten['d'] ?? '') @@ -245,6 +293,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['d' => $data['d']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('e') ->label($spalten['e'] ?? '') @@ -262,6 +312,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['e' => $data['e']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('f') ->label($spalten['f'] ?? '') @@ -279,6 +331,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['f' => $data['f']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('g') ->label($spalten['g'] ?? '') @@ -296,6 +350,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['g' => $data['g']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('h') ->label($spalten['h'] ?? '') @@ -313,6 +369,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['h' => $data['h']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('i') ->label($spalten['i'] ?? '') @@ -330,6 +388,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['i' => $data['i']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), BulkAction::make('j') ->label($spalten['j'] ?? '') @@ -347,6 +407,8 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager ['j' => $data['j']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshOrientierung'); }), ]), ]); diff --git a/app/Filament/Resources/Projektes/RelationManagers/ProjektMethodesRelationManager.php b/app/Filament/Resources/Projektes/RelationManagers/ProjektMethodesRelationManager.php index 86b34aa..deec503 100644 --- a/app/Filament/Resources/Projektes/RelationManagers/ProjektMethodesRelationManager.php +++ b/app/Filament/Resources/Projektes/RelationManagers/ProjektMethodesRelationManager.php @@ -17,6 +17,7 @@ use Filament\Tables\Columns\TextInputColumn; use Filament\Tables\Filters\TernaryFilter; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Collection; +use Livewire\Component; class ProjektMethodesRelationManager extends RelationManager { @@ -39,14 +40,26 @@ class ProjektMethodesRelationManager extends RelationManager SelectColumn::make('methode_id') ->selectablePlaceholder(true) ->optionsRelationship('methode', 'name') - ->preloadOptions(), + ->preloadOptions() + ->rules(['required']) + ->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshMethods'); + })->validationMessages([ + 'required' => 'Die Eingabe eines Faktors ist erforderlich.', + ]), TextColumn::make('raumart') ->searchable(), TextInputColumn::make('faktor') ->suffixIcon('phosphor-function') ->width('1rem') ->rules(['required', 'faktor' => 'decimal:0,2']) - ->searchable(), + ->searchable() + ->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshMethods'); + })->validationMessages([ + 'required' => 'Die Eingabe eines Faktors ist erforderlich.', + 'decimal' => 'Für den Faktors sind zwei Dezimalstellen erforderlich.', + ]), ]) ->filters([ TernaryFilter::make('methode_id') @@ -61,47 +74,54 @@ class ProjektMethodesRelationManager extends RelationManager ->modalSubmitActionLabel('Erstellen') ->label('Erstellen') ->tooltip('Daten werden aus "Räume Alle" Tabelle gefiltert.') - ->icon('heroicon-o-cog-8-tooth'), + ->icon('heroicon-o-cog-8-tooth') + ->after(function (Component $livewire) { + $livewire->dispatch('refreshMethods'); + }), ]) ->toolbarActions([ BulkActionGroup::make([ BulkAction::make('faktor') - ->color('primary') - ->label('Faktor zuweisen') - ->schema([ - TextInput::make('faktor') - ->prefixIcon('phosphor-function') - ->numeric() - ->required(), - ]) - ->icon('phosphor-function') - ->action(function (Collection $records, array $data): void { - foreach ($records as $record) { - ProjektMethode::where('id', '=', $record->id) - ->update( - ['faktor' => $data['faktor']] - ); - } - }), + ->color('primary') + ->label('Faktor zuweisen') + ->schema([ + TextInput::make('faktor') + ->prefixIcon('phosphor-function') + ->numeric() + ->required(), + ]) + ->icon('phosphor-function') + ->action(function (Collection $records, array $data): void { + foreach ($records as $record) { + ProjektMethode::where('id', '=', $record->id) + ->update( + ['faktor' => $data['faktor']] + ); + } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshMethods'); + }), BulkAction::make('methode') - ->color('primary') - ->label('Methode zuweisen') - ->schema([ - Select::make('methode_id') - ->label('Methode') - ->prefixIcon('phosphor-calculator') - ->options(Methode::pluck('name', 'id')) - ->required(), - ]) - ->icon('phosphor-calculator') - ->action(function (Collection $records, array $data): void { - foreach ($records as $record) { - ProjektMethode::where('id', '=', $record->id) - ->update( - ['methode_id' => $data['methode_id']] - ); - } - }), + ->color('primary') + ->label('Methode zuweisen') + ->schema([ + Select::make('methode_id') + ->label('Methode') + ->prefixIcon('phosphor-calculator') + ->options(Methode::pluck('name', 'id')) + ->required(), + ]) + ->icon('phosphor-calculator') + ->action(function (Collection $records, array $data): void { + foreach ($records as $record) { + ProjektMethode::where('id', '=', $record->id) + ->update( + ['methode_id' => $data['methode_id']] + ); + } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshMethods'); + }), ]), ]); } diff --git a/app/Filament/Resources/Projektes/RelationManagers/RaeumeallesRelationManager.php b/app/Filament/Resources/Projektes/RelationManagers/RaeumeallesRelationManager.php index 066a5c1..77cbca6 100644 --- a/app/Filament/Resources/Projektes/RelationManagers/RaeumeallesRelationManager.php +++ b/app/Filament/Resources/Projektes/RelationManagers/RaeumeallesRelationManager.php @@ -24,6 +24,7 @@ use Filament\Tables\Table; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\HtmlString; use Illuminate\Validation\Rules\File; +use Livewire\Component; class RaeumeallesRelationManager extends RelationManager { @@ -41,9 +42,35 @@ class RaeumeallesRelationManager extends RelationManager { return $schema ->components([ + TextInput::make('top_nummer') + ->required() + ->maxLength(255), TextInput::make('geschoss') ->required() ->maxLength(255), + TextInput::make('raumart') + ->required() + ->maxLength(255), + TextInput::make('flaeche') + ->suffix(new HtmlString(' m²')) + ->rules(['required', 'flaeche' => 'decimal:2']) + ->label('Fläche') + ->validationMessages([ + 'required' => 'Die Eingabe einer Fläche ist erforderlich.', + 'decimal' => 'Für die Fläche sind zwei Dezimalstellen erforderlich.', + ]) + ->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshAllgemeinflaechen'); + }), + TextInput::make('faktor') + ->suffixIcon('phosphor-function') + ->rules(['required', 'faktor' => 'decimal:0,2']) + ->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshRaeumealle'); + })->validationMessages([ + 'required' => 'Die Eingabe eines Faktors ist erforderlich.', + 'decimal' => 'Für den Faktors sind zwei Dezimalstellen erforderlich.', + ]), ]); } @@ -63,7 +90,13 @@ class RaeumeallesRelationManager extends RelationManager ->suffixIcon('phosphor-function') ->width('1rem') ->rules(['required', 'faktor' => 'decimal:0,2']) - ->searchable(), + ->searchable() + ->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshRaeumealle'); + })->validationMessages([ + 'required' => 'Die Eingabe eines Faktors ist erforderlich.', + 'decimal' => 'Für den Faktors sind zwei Dezimalstellen erforderlich.', + ]), TextInputColumn::make('flaeche') ->summarize(Sum::make()->label('Gesammt')->numeric( decimalPlaces: 2, @@ -73,7 +106,13 @@ class RaeumeallesRelationManager extends RelationManager ->alignment('right') ->rules(['required', 'flaeche' => 'decimal:2']) ->label('Fläche') - ->searchable(), + ->searchable() + ->afterStateUpdated(function (Component $livewire) { + $livewire->dispatch('refreshRaeumealle'); + })->validationMessages([ + 'required' => 'Die Eingabe einer Fläche ist erforderlich.', + 'decimal' => 'Für die Fläche sind zwei Dezimalstellen erforderlich.', + ]), TextColumn::make('nutzwert') ->alignCenter() ->default(fn ($record): ?int => round($record->faktor * $record->flaeche)) @@ -115,8 +154,12 @@ class RaeumeallesRelationManager extends RelationManager ]), ]) ->recordActions([ - EditAction::make()->iconButton(), - DeleteAction::make()->iconButton(), + EditAction::make()->iconButton()->after(function (Component $livewire) { + $livewire->dispatch('refreshRaeumealle'); + }), + DeleteAction::make()->iconButton()->after(function (Component $livewire) { + $livewire->dispatch('refreshRaeumealle'); + }), ]) ->toolbarActions([ BulkActionGroup::make([ @@ -137,8 +180,12 @@ class RaeumeallesRelationManager extends RelationManager ['faktor' => $data['faktor']] ); } + })->after(function (Component $livewire) { + $livewire->dispatch('refreshRaeumealle'); }), - DeleteBulkAction::make(), + DeleteBulkAction::make()->after(function (Component $livewire) { + $livewire->dispatch('refreshRaeumealle'); + }), ]), ]); } diff --git a/app/Models/Allgemeinflaechen.php b/app/Models/Allgemeinflaechen.php index abe920a..5738546 100644 --- a/app/Models/Allgemeinflaechen.php +++ b/app/Models/Allgemeinflaechen.php @@ -18,7 +18,7 @@ class Allgemeinflaechen extends Model parent::boot(); self::updated(function ($model) { - Projekte::where('id', $model['projekte_id'])->update(['evaluation' => false]); + Projekte::where('id', $model['projekte_id'])->update(['evaluation_gutachten' => false]); }); } } diff --git a/app/Models/OrientierungZuAbschlaege.php b/app/Models/OrientierungZuAbschlaege.php index 9b91b18..b96af3b 100644 --- a/app/Models/OrientierungZuAbschlaege.php +++ b/app/Models/OrientierungZuAbschlaege.php @@ -24,6 +24,15 @@ class OrientierungZuAbschlaege extends Model 'j', ]; + public static function boot() + { + parent::boot(); + + self::updated(function ($model) { + Projekte::where('id', $model['projekte_id'])->update(['evaluation_gutachten' => false]); + }); + } + public function orientierung() { return $this->hasOne(Orientierung::class, 'id', 'orientierung_id'); diff --git a/app/Models/ProjektMethode.php b/app/Models/ProjektMethode.php index f1d2d02..70dec26 100644 --- a/app/Models/ProjektMethode.php +++ b/app/Models/ProjektMethode.php @@ -14,6 +14,15 @@ class ProjektMethode extends Model 'flaeche', ]; + public static function boot() + { + parent::boot(); + + self::updated(function ($model) { + Projekte::where('id', $model['projekte_id'])->update(['evaluation_gutachten' => false]); + }); + } + public function methode() { return $this->hasOne(Methode::class, 'id', 'methode_id'); diff --git a/app/Models/Raeumealle.php b/app/Models/Raeumealle.php index caaa345..634f841 100644 --- a/app/Models/Raeumealle.php +++ b/app/Models/Raeumealle.php @@ -15,4 +15,13 @@ class Raeumealle extends Model 'faktor', 'flaeche', ]; + + public static function boot() + { + parent::boot(); + + self::updated(function ($model) { + Projekte::where('id', $model['projekte_id'])->update(['evaluation_gutachten' => false]); + }); + } } diff --git a/bootstrap/cache/routes-v7.php b/bootstrap/cache/routes-v7.php index 27f5bce..e26d033 100644 --- a/bootstrap/cache/routes-v7.php +++ b/bootstrap/cache/routes-v7.php @@ -531,7 +531,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::cMFYRNr1o1PRseSZ', + '_route' => 'generated::exIAp0EADn5yoY2H', ), 1 => NULL, 2 => @@ -551,7 +551,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::2x2QKQMIdsdiHpyb', + '_route' => 'generated::fzMVy1Jf9tAsto8V', ), 1 => NULL, 2 => @@ -609,7 +609,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::hszD9fZTxpanIoJv', + '_route' => 'generated::RbpkeOigW19C0cYF', ), 1 => NULL, 2 => @@ -629,7 +629,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::elk9I3a8y1xOVGye', + '_route' => 'generated::rS6V9GEwPgiewAuw', ), 1 => NULL, 2 => @@ -649,7 +649,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::9FyTMqQa1k6WGHuY', + '_route' => 'generated::w1rEzg4szFuoQGRb', ), 1 => NULL, 2 => @@ -669,7 +669,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::pR5eI8BwQCtOz6j1', + '_route' => 'generated::aBLuOJDcLU7fag3q', ), 1 => NULL, 2 => @@ -689,7 +689,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::9p3WHLQBm12TOrAJ', + '_route' => 'generated::AjOyKv2jzRor1QA5', ), 1 => NULL, 2 => @@ -2740,7 +2740,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::cMFYRNr1o1PRseSZ' => + 'generated::exIAp0EADn5yoY2H' => array ( 'methods' => array ( @@ -2752,7 +2752,7 @@ app('router')->setCompiledRoutes( array ( 'uses' => 'Livewire\\Mechanisms\\FrontendAssets\\FrontendAssets@returnJavaScriptAsFile', 'controller' => 'Livewire\\Mechanisms\\FrontendAssets\\FrontendAssets@returnJavaScriptAsFile', - 'as' => 'generated::cMFYRNr1o1PRseSZ', + 'as' => 'generated::exIAp0EADn5yoY2H', ), 'fallback' => false, 'defaults' => @@ -2768,7 +2768,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::2x2QKQMIdsdiHpyb' => + 'generated::fzMVy1Jf9tAsto8V' => array ( 'methods' => array ( @@ -2780,7 +2780,7 @@ app('router')->setCompiledRoutes( array ( 'uses' => 'Livewire\\Mechanisms\\FrontendAssets\\FrontendAssets@maps', 'controller' => 'Livewire\\Mechanisms\\FrontendAssets\\FrontendAssets@maps', - 'as' => 'generated::2x2QKQMIdsdiHpyb', + 'as' => 'generated::fzMVy1Jf9tAsto8V', ), 'fallback' => false, 'defaults' => @@ -2882,7 +2882,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::hszD9fZTxpanIoJv' => + 'generated::RbpkeOigW19C0cYF' => array ( 'methods' => array ( @@ -2911,7 +2911,7 @@ app('router')->setCompiledRoutes( \'exception\' => $exception, ]), status: $exception ? 500 : 200); }";s:5:"scope";s:54:"Illuminate\\Foundation\\Configuration\\ApplicationBuilder";s:4:"this";N;s:4:"self";s:32:"0000000000000f3b0000000000000000";}}', - 'as' => 'generated::hszD9fZTxpanIoJv', + 'as' => 'generated::RbpkeOigW19C0cYF', ), 'fallback' => false, 'defaults' => @@ -2927,7 +2927,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::elk9I3a8y1xOVGye' => + 'generated::rS6V9GEwPgiewAuw' => array ( 'methods' => array ( @@ -2949,7 +2949,7 @@ app('router')->setCompiledRoutes( 'where' => array ( ), - 'as' => 'generated::elk9I3a8y1xOVGye', + 'as' => 'generated::rS6V9GEwPgiewAuw', ), 'fallback' => false, 'defaults' => @@ -2965,7 +2965,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::9FyTMqQa1k6WGHuY' => + 'generated::w1rEzg4szFuoQGRb' => array ( 'methods' => array ( @@ -2987,7 +2987,7 @@ app('router')->setCompiledRoutes( 'where' => array ( ), - 'as' => 'generated::9FyTMqQa1k6WGHuY', + 'as' => 'generated::w1rEzg4szFuoQGRb', ), 'fallback' => false, 'defaults' => @@ -3003,7 +3003,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::pR5eI8BwQCtOz6j1' => + 'generated::aBLuOJDcLU7fag3q' => array ( 'methods' => array ( @@ -3025,7 +3025,7 @@ app('router')->setCompiledRoutes( 'where' => array ( ), - 'as' => 'generated::pR5eI8BwQCtOz6j1', + 'as' => 'generated::aBLuOJDcLU7fag3q', ), 'fallback' => false, 'defaults' => @@ -3041,7 +3041,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::9p3WHLQBm12TOrAJ' => + 'generated::AjOyKv2jzRor1QA5' => array ( 'methods' => array ( @@ -3063,7 +3063,7 @@ app('router')->setCompiledRoutes( 'where' => array ( ), - 'as' => 'generated::9p3WHLQBm12TOrAJ', + 'as' => 'generated::AjOyKv2jzRor1QA5', ), 'fallback' => false, 'defaults' => diff --git a/composer.lock b/composer.lock index 64746ff..10783b1 100644 --- a/composer.lock +++ b/composer.lock @@ -9438,28 +9438,28 @@ }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "541057574806f942c94662b817a50f63f7345360" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/541057574806f942c94662b817a50f63f7345360", + "reference": "541057574806f942c94662b817a50f63f7345360", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", "php": "^7.2 || ^8.0" }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { @@ -9490,9 +9490,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/1.12.0" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2025-10-20T12:43:39+00:00" }, { "name": "ysfkaya/filament-phone-input", diff --git a/database/migrations/2025_09_24_131440_create_projektes_table.php b/database/migrations/2025_09_24_131440_create_projektes_table.php index 248a3b4..f168fdb 100644 --- a/database/migrations/2025_09_24_131440_create_projektes_table.php +++ b/database/migrations/2025_09_24_131440_create_projektes_table.php @@ -28,7 +28,8 @@ return new class extends Migration $table->boolean('pdf_nutzwerte_status')->default(0); $table->boolean('pdf_gutachten_status')->default(0); $table->boolean('excel_nutzwerte_status')->default(0); - $table->boolean('evaluation')->default(0); + $table->boolean('evaluation_gutachten')->default(0); + $table->boolean('evaluation_nutzwerte')->default(0); $table->timestamp('bezahlt_am')->nullable(); $table->timestamps(); $table->softDeletes(); diff --git a/resources/svg/pdf.svg b/resources/svg/pdf.svg index 3dc8a3a..a905171 100644 --- a/resources/svg/pdf.svg +++ b/resources/svg/pdf.svg @@ -1,14 +1,22 @@ - - - - - pdf-document - - - - - + + + + + + - \ No newline at end of file +