excel aufstellung finale

This commit is contained in:
salam committed 2025-11-18 17:57:58 +01:00
1 parent ebb51923a6
commit ebff82bd0e
19 files changed
+4766 -82

No files matched your search

@@ -195,13 +195,13 @@ class EditProjekte extends EditRecord
Action::make('excel-nutzwerte')
->label('Nutzfläche & Nutzwerte')
->icon('icon-excel')
->url(fn ($record) => route('excel', ['record' => $record, 'part' => 'nutzwerte']))
->url(fn ($record) => route('excelnutzwerte', ['record' => $record]))
->hidden(fn ($record): bool => (! $record->bezahlt_am || ! $record->evaluation_gutachten) ? true : false)
->openUrlInNewTab(),
Action::make('excel-aufstellung')
->label('Nutzflächen Aufstellung')
->icon('icon-excel')
->url(fn ($record) => route('excel', ['record' => $record, 'part' => 'aufstellung']))
->url(fn ($record) => route('excelaufstellung', ['record' => $record]))
->hidden(fn ($record): bool => (! $record->bezahlt_am || ! $record->evaluation_gutachten) ? true : false)
->openUrlInNewTab(),
])->label('Excel')
@@ -3,6 +3,7 @@
namespace App\Filament\Resources\Projektes\RelationManagers;
use App\Actions\Create\CreateProjektMethoden;
use App\Models\Aufstellung;
use App\Models\Methode;
use App\Models\ProjektMethode;
use App\Models\ProjektObjekteImDetail;
@@ -52,6 +53,17 @@ class ProjektMethodesRelationManager extends RelationManager
})->validationMessages([
'required' => 'Die Eingabe einer Methode ist erforderlich.',
]),
SelectColumn::make('aufstellung_id')
->label('Aufstellung')
->optionsRelationship('aufstellung', 'name')
->preloadOptions()
->rules(['required'])
->afterStateUpdated(function (Component $livewire) {
$livewire->dispatch('refreshMethods');
})->validationMessages([
'required' => 'Die Eingabe einer Aufstellung ist erforderlich.',
]),
TextColumn::make('raumart')
->searchable(),
TextInputColumn::make('faktor')
@@ -166,6 +178,28 @@ class ProjektMethodesRelationManager extends RelationManager
})->after(function (Component $livewire) {
$livewire->dispatch('refreshMethods');
}),
BulkAction::make('aufstellung')
->color('primary')
->label('Aufstellung zuweisen')
->schema([
Select::make('aufstellung_id')
->label('Aufstellung')
->prefixIcon('phosphor-finn-the-human')
->options(Aufstellung::pluck('name', 'id'))
->required(),
])
->icon('phosphor-finn-the-human')
->action(function (Collection $records, array $data): void {
foreach ($records as $record) {
/** @var object $record */
ProjektMethode::where('id', '=', $record->id)
->update(
['aufstellung_id' => $data['aufstellung_id']]
);
}
})->after(function (Component $livewire) {
$livewire->dispatch('refreshMethods');
}),
]),
]);
}