rename ProjektRaeumealle ro ProjektObjekte und ProjektObjekteImDetail
This commit is contained in:
1 parent
7746b426b3
commit
967d6e5157
30 files changed
+342
-292
No files matched your search
@@ -6,9 +6,9 @@ use App\Models\ProjektAllgemeinflaechen;
|
||||
use App\Models\Projekte;
|
||||
use App\Models\ProjektInhaltsverzeichnis;
|
||||
use App\Models\ProjektMethode;
|
||||
use App\Models\ProjektOrientierungZuAbschlaege;
|
||||
use App\Models\ProjektObjekte;
|
||||
use App\Models\ProjektObjekteImDetail;
|
||||
use App\Models\ProjektPlatzhalter;
|
||||
use App\Models\ProjektRaeumealle;
|
||||
use Filament\Notifications\Notification;
|
||||
|
||||
class GutachtenValidation
|
||||
@@ -21,7 +21,7 @@ class GutachtenValidation
|
||||
$res = ProjektAllgemeinflaechen::where('projekte_id', $record->id)->get();
|
||||
if (! $res->count()) {
|
||||
Notification::make()
|
||||
->title('Allgemeinflächen')
|
||||
->title('Tabelle Allgemeinflächen')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
@@ -33,7 +33,7 @@ class GutachtenValidation
|
||||
foreach ($res as $value) {
|
||||
if (! $value->geschoss) {
|
||||
Notification::make()
|
||||
->title('Allgemeinflächen')
|
||||
->title('Tabelle Allgemeinflächen')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
@@ -44,7 +44,7 @@ class GutachtenValidation
|
||||
}
|
||||
if (! $value->raumart) {
|
||||
Notification::make()
|
||||
->title('Allgemeinflächen')
|
||||
->title('Tabelle Allgemeinflächen')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
@@ -55,7 +55,7 @@ class GutachtenValidation
|
||||
}
|
||||
if ($value->flaeche == 0) {
|
||||
Notification::make()
|
||||
->title('Allgemeinflächen')
|
||||
->title('Tabelle Allgemeinflächen')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
@@ -67,58 +67,113 @@ class GutachtenValidation
|
||||
}
|
||||
|
||||
/**
|
||||
* ProjektRaeumealle
|
||||
* ProjektObjekte + nicht_in_orientierung
|
||||
*/
|
||||
$res = ProjektRaeumealle::where('projekte_id', $record->id)->get();
|
||||
$res = ProjektObjekte::where('projekte_id', $record->id)->get();
|
||||
if (! $res->count()) {
|
||||
Notification::make()
|
||||
->title('Räume Alle')
|
||||
->title('Tabelle Objekte')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Die Tabelle <b>Räume Alle</b> ist leer.')
|
||||
->body('Die Tabelle <b>Objekte</b> ist leer.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
$res = ProjektObjekte::where('projekte_id', $record->id)->where('nicht_in_orientierung', false)->get();
|
||||
foreach ($res as $value) {
|
||||
if (! $value->orientierung_id && ! $value->nicht_in_orientierung) {
|
||||
Notification::make()
|
||||
->title('Tabelle Objekte')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Bei der Top Nummer <b>'.$value->top_nummer.'</b> fehlt die <u>Orientierung</u>.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
if (! $value->orientierung_id && ! $value->type) {
|
||||
Notification::make()
|
||||
->title('Tabelle Objekte')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Bei der Top Nummer <b>'.$value->top_nummer.'</b> fehlt der <u>Type</u>.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* ProjektObjekte & ProjektObjekteImDetail
|
||||
*/
|
||||
$res = ProjektObjekte::with('ProjektObjekteImDetail')->where('projekte_id', $record->id)->get();
|
||||
if (! $res->count()) {
|
||||
Notification::make()
|
||||
->title('Tabelle Objekte im Detail')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Die Tabelle <b>Objekte im Detail</b> ist leer.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($res as $value) {
|
||||
|
||||
$raeume = $value->ProjektObjekteImDetail->toArray();
|
||||
$raeume = $raeume[0] ?? [];
|
||||
|
||||
if (! count($raeume)) {
|
||||
Notification::make()
|
||||
->title('Tabelle Objekte')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Der Top Nummer <b>'.$value->top_nummer.'</b> sind keine Räume zugeordnet.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
if (! $value->top_nummer) {
|
||||
Notification::make()
|
||||
->title('Räume Alle')
|
||||
->title('Tabelle Objekte')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Für den Raum <b>'.$value->raumart.'</b> im Geschoss <b>'.$value->geschoss.'</b> fehlt die Angabe der <u>Top Nummer</u>.')
|
||||
->body('Für den Raum mit der ID <b>'.$value->id.'</b> fehlt die Angabe der <u>Top Nummer</u>.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
if (! $value->geschoss) {
|
||||
if (! $raeume['geschoss']) {
|
||||
Notification::make()
|
||||
->title('Räume Alle')
|
||||
->title('Tabelle Objekte im Detail')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Für den Raum <b>'.$value->raumart.'</b> mit der Top Nummer <b>'.$value->top_nummer.'</b> fehlt die Angabe der <u>Geschoßes</u>.')
|
||||
->body('Beim Objekt Top Nummer <b>'.$value->top_nummer.'</b> fehlt die Angabe des <u>Geschoßes</u>.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
if (! $value->raumart) {
|
||||
if (! $raeume['raumart']) {
|
||||
Notification::make()
|
||||
->title('Räume Alle')
|
||||
->title('Tabelle Objekte im Detail')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Für den Raum mit der Top Nummer <b>'.$value->top_nummer.'</b> im Geschoßes <b>'.$value->geschoss.'</b> fehlt die Angabe der <u>Raumart</u>.')
|
||||
->body('Beim Objekt Top Nummer <b>'.$value->top_nummer.'</b> fehlt die Angabe der <u>Raumart</u>.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
if ($value->flaeche == 0) {
|
||||
if (! $raeume['flaeche']) {
|
||||
Notification::make()
|
||||
->title('Räume Alle')
|
||||
->title('Tabelle Objekte im Detail')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
@@ -127,17 +182,6 @@ class GutachtenValidation
|
||||
|
||||
return false;
|
||||
}
|
||||
if ($value->faktor == 0) {
|
||||
Notification::make()
|
||||
->title('Räume Alle')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Für die Raumart <b>'.$value->raumart.'</b> mit der Top Nummer <b>'.$value->top_nummer.'</b> im Geschoss <b>'.$value->geschoss.'</b> fehlt die Angabe des <u>Faktors</u>.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +190,7 @@ class GutachtenValidation
|
||||
$res = ProjektMethode::where('projekte_id', $record->id)->get();
|
||||
if (! $res->count()) {
|
||||
Notification::make()
|
||||
->title('Räume Methoden')
|
||||
->title('Tabelle Räume Methoden')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
@@ -158,7 +202,7 @@ class GutachtenValidation
|
||||
foreach ($res as $value) {
|
||||
if (! $value->methode_id) {
|
||||
Notification::make()
|
||||
->title('Räume Methoden')
|
||||
->title('Tabelle Räume Methoden')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
@@ -167,58 +211,18 @@ class GutachtenValidation
|
||||
|
||||
return false;
|
||||
}
|
||||
if ($value->faktor == 0) {
|
||||
Notification::make()
|
||||
->title('Räume Methoden')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Für den Raum <b>'.$value->raumart.'</b> fehlt die Angabe des <u>Faktors</u>.')
|
||||
->send();
|
||||
// KANN 0 SEIN
|
||||
// if ($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 die Angabe des <u>Faktors</u>.')
|
||||
// ->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Orientierung Zu und Abschläge
|
||||
*/
|
||||
$res = ProjektOrientierungZuAbschlaege::where('projekte_id', $record->id)->get();
|
||||
if (! $res->count()) {
|
||||
Notification::make()
|
||||
->title('Orientierung Zu und Abschläge')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Die Tabelle <b>Orientierung Zu und Abschläge</b> ist leer.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
$res = ProjektOrientierungZuAbschlaege::where('projekte_id', $record->id)->where('nicht_in_orientierung', false)->get();
|
||||
foreach ($res as $value) {
|
||||
if (! $value->orientierung_id && ! $value->nicht_in_orientierung) {
|
||||
Notification::make()
|
||||
->title('Orientierung Zu und Abschläge')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Bei der Top Nummer <b>'.$value->top_nummer.'</b> fehlt die <u>Orientierung</u>.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
if (! $value->orientierung_id && ! $value->type) {
|
||||
Notification::make()
|
||||
->title('Orientierung Zu und Abschläge')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
->body('Bei der Top Nummer <b>'.$value->top_nummer.'</b> fehlt der <u>Type</u>.')
|
||||
->send();
|
||||
|
||||
return false;
|
||||
}
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,7 +231,7 @@ class GutachtenValidation
|
||||
$res = ProjektInhaltsverzeichnis::where('projekte_id', $record->id)->get();
|
||||
if (! $res->count()) {
|
||||
Notification::make()
|
||||
->title('Inhaltsverzeichnis')
|
||||
->title('Tabelle Inhaltsverzeichnis')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->body('Inhaltsverzeichnis fehlt!')
|
||||
@@ -243,7 +247,7 @@ class GutachtenValidation
|
||||
$res = ProjektPlatzhalter::where('projekte_id', $record->id)->whereNull('platzhaltertext')->orWhere('platzhaltertext', '=', '')->get();
|
||||
if ($res->count()) {
|
||||
Notification::make()
|
||||
->title('Platzhalter')
|
||||
->title('Tabelle Platzhalter')
|
||||
->info()
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->duration(10000)
|
||||
@@ -254,7 +258,7 @@ class GutachtenValidation
|
||||
}
|
||||
|
||||
Notification::make()
|
||||
->title('Evaluation')
|
||||
->title('Evaluierung')
|
||||
->success()
|
||||
->duration(10000)
|
||||
->body('Die Evaluierung des Projektes war erfolgreich.')
|
||||
|
||||
Reference in new issue
Block a user