GutachtenValidation

This commit is contained in:
salam committed 2025-10-17 18:04:34 +02:00
1 parent d1ce891d9c
commit 8ccc4a3c20
15 files changed
+390 -109

No files matched your search

@@ -99,6 +99,8 @@ class AuftraggeberForm
FileUpload::make('logo')
->image()
->disk('public')
->maxSize(3072) // 3MB limit
->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])
->directory('auftraggeber-logo')
->visibility('public')
->label('Logo')
@@ -108,6 +108,8 @@ class GutachterForm
->image()
->disk('public')
->directory('gutachter-logo')
->maxSize(3072) // 3MB limit
->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])
->visibility('public')
->label('Logo'),
Radio::make('logo_align')
@@ -2,6 +2,7 @@
namespace App\Filament\Resources\Projektes\Pages;
use App\Actions\Validation\GutachtenValidation;
use App\Filament\Resources\Projektes\ProjekteResource;
use App\Models\Konto;
use App\Models\Projekte;
@@ -72,10 +73,26 @@ class EditProjekte extends EditRecord
->openUrlInNewTab(),
Action::make('make_gutachten')
->hidden(fn ($record): bool => $record->bezahlt_am ? false : true)
->color(fn ($record): string => match ($record->evaluation) {
1 => 'info',
default => 'gray',
})
->disabled(fn ($record): bool => $record->evaluation ? false : true)
->label('Neu 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 => 'gray',
default => 'info',
})
->label('Daten Evaluieren')
->icon('phosphor-seal-check')
->action(function ($record): void {
GutachtenValidation::controll($record);
}),
])->label('Gutachten')
->icon('heroicon-m-ellipsis-vertical')
->button()
@@ -9,6 +9,7 @@ use App\Models\OrientierungZuAbschlaege;
use Filament\Actions\Action;
use Filament\Actions\BulkAction;
use Filament\Actions\BulkActionGroup;
use Filament\Forms\Components\Radio;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Resources\RelationManagers\RelationManager;
@@ -58,10 +59,10 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager
CheckboxColumn::make('nicht_in_orientierung')
->label('Nicht in Orientierung')
->toggleable(),
TextInputColumn::make('raumart')
TextColumn::make('raumart')
->toggleable()
->width('2rem')
->rules(['required'])
// ->rules(['required'])
->searchable(),
SelectColumn::make('orientierung_id')
->toggleable()
@@ -156,8 +157,29 @@ class OrientierungZuAbschlaegesRelationManager extends RelationManager
);
}
}),
BulkAction::make('nicht_in_orientierung')
->color('primary')
->label('Nicht In Orientierung')
->schema([
Radio::make('nicht_in_orientierung')
->hiddenLabel()
->default(1)
->options([
'1' => 'Ja',
'0' => 'Nein',
]),
])
->icon('phosphor-arrow-square-out')
->action(function (Collection $records, array $data): void {
foreach ($records as $record) {
OrientierungZuAbschlaege::where('id', '=', $record->id)
->update(
['nicht_in_orientierung' => 1]
);
}
}),
BulkAction::make('a')
->label($spalten['a'] ?? '')
->label($spalten['a'].' Faktor' ?? '')
->color('info')
->hidden(isset($spalten['a']) ? false : true)
->schema([