changes done
This commit is contained in:
1 parent
ddbf171881
commit
03fc1074b9
25 files changed
+471
-426
No files matched your search
@@ -21,10 +21,10 @@ class ExcelAufstellung
|
||||
{
|
||||
public static function make($projekte_id)
|
||||
{
|
||||
$black = 'ff000000';
|
||||
$blue = 'ff162456';
|
||||
$green = 'ff192e03';
|
||||
$border = 'ff737373';
|
||||
$black = 'ff62748e';
|
||||
$blue = 'ff2b7fff';
|
||||
$green = 'ff00bc7d';
|
||||
$border = 'ff57534d';
|
||||
|
||||
$projekt = Projekte::where('id', $projekte_id)->first();
|
||||
|
||||
|
||||
@@ -219,6 +219,17 @@ class GutachtenValidation
|
||||
|
||||
return false;
|
||||
}
|
||||
if ($value->methode_id != 1 && $value->faktor == 0) {
|
||||
Notification::make()
|
||||
->title('Tabelle Räume Methoden')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Für den Raum <b>'.$value->raumart.'</b> fehlt ein <u>Faktor</u>.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,7 @@ class InhaltsverzeichnisForm
|
||||
Checkbox::make('neue_seite')
|
||||
->label('Start neuer Seite'),
|
||||
Checkbox::make('ueberschrift_verbergen')
|
||||
->label('Überschrift verbergen'),
|
||||
->label('Überschrift im Gutachten verbergen'),
|
||||
TextInput::make('name')
|
||||
->prefixIcon('phosphor-article')
|
||||
->required()
|
||||
|
||||
+2
-2
@@ -54,8 +54,8 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
|
||||
->schema([
|
||||
Checkbox::make('neue_seite')
|
||||
->label('Start neuer Seite'),
|
||||
// Checkbox::make('ueberschrift_verbergen')
|
||||
// ->label('Überschrift verbergen'),
|
||||
Checkbox::make('ueberschrift_verbergen')
|
||||
->label('Überschrift im Gutachten verbergen'),
|
||||
TextInput::make('name')
|
||||
->prefixIcon('phosphor-article')
|
||||
->afterLabel([ShowHelpInhalt::show()])
|
||||
|
||||
+10
-3
@@ -15,6 +15,7 @@ use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Columns\SelectColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
@@ -51,22 +52,28 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
$livewire->dispatch('refreshMethods');
|
||||
})->validationMessages([
|
||||
'required' => 'Die Eingabe einer Methode ist erforderlich.',
|
||||
]),
|
||||
])
|
||||
->live(),
|
||||
Select::make('aufstellung_id')
|
||||
->visible(fn (Get $get): bool => ! in_array($get('methode_id'), [1, 5]))
|
||||
->label('Aufstellung')
|
||||
->options(Aufstellung::pluck('name', 'id'))
|
||||
->afterStateUpdated(function (Component $livewire) {
|
||||
$livewire->dispatch('refreshMethods');
|
||||
}),
|
||||
TextInput::make('faktor')
|
||||
->visible(fn (Get $get): bool => $get('methode_id') != 1)
|
||||
->suffixIcon('phosphor-function')
|
||||
->numeric()
|
||||
->label('Fläche')
|
||||
->rules(['required'])
|
||||
->validationMessages([
|
||||
'required' => 'Die Eingabe einer Fläche ist erforderlich.',
|
||||
]),
|
||||
])->columns(3);
|
||||
])
|
||||
->afterStateUpdated(function (Component $livewire) {
|
||||
$livewire->dispatch('refreshMethods');
|
||||
}),
|
||||
])->columns(1);
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
|
||||
+2
-3
@@ -145,9 +145,8 @@ class ProjektObjekteImDetailRelationManager extends RelationManager
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()->iconButton()
|
||||
->mutateDataUsing(function ($data): array {
|
||||
|
||||
$data['nutzwert'] = round($data['faktor'] * $data['flaeche']);
|
||||
->mutateDataUsing(function ($data, $record): array {
|
||||
$data['nutzwert'] = round($record->methode->faktor * $data['flaeche']);
|
||||
|
||||
return $data;
|
||||
})->after(function (Component $livewire) {
|
||||
|
||||
@@ -12,7 +12,7 @@ class ProjektMethode extends Model
|
||||
'aufstellung_id',
|
||||
'geschoss',
|
||||
'raumart',
|
||||
'flaeche',
|
||||
'faktor',
|
||||
];
|
||||
|
||||
public static function boot()
|
||||
|
||||
Reference in new issue
Block a user