From 523e39506458861861e9c603994494c75f58ff96 Mon Sep 17 00:00:00 2001 From: salam Date: Fri, 31 Oct 2025 15:25:16 +0100 Subject: [PATCH] pdf wip --- app/Actions/Create/CreatePlatzhalter.php | 18 +- .../CreateProjektInhaltsverzeichnis.php | 51 ++--- app/Actions/Download/Excel.php | 53 ----- app/Actions/Download/Gutachten.php | 64 ------ app/Actions/Download/Nutzwerte.php | 66 ------ app/Actions/Generate/Excel.php | 13 ++ app/Actions/Generate/Gutachten/Deckblatt.php | 52 ----- app/Actions/Generate/MakeNutzwerte.php | 2 +- .../{MakeGutachten.php => MakeParagraph6.php} | 25 ++- .../Nutzwerte/ProjektAllgemeinflaechens.php | 47 ---- .../Generate/Nutzwerte/ZuUndAbschlaege.php | 13 +- app/Actions/Generate/Pdf.php | 144 ++++++++++++ app/Actions/Generate/Pdf/Deckblatt.php | 49 +++++ app/Actions/Generate/Pdf/DigitaleSignatur.php | 13 ++ .../Generate/{Gutachten => Pdf}/Inhalt.php | 4 +- .../{Gutachten => Pdf}/Platzhalter.php | 2 +- .../{Gutachten => Pdf}/Ueberschrift.php | 2 +- .../Allgemeinflaechen.php} | 6 +- .../Paragraph6.php} | 9 +- .../Validation/GutachtenValidation.php | 22 ++ .../Gutachters/Tables/GutachtersTable.php | 4 + .../Projektes/Pages/EditProjekte.php | 76 +++---- app/Models/ProjektAllgemeinflaechen.php | 2 - app/Models/ProjektMethode.php | 2 - app/Models/ProjektObjekte.php | 7 +- app/Models/ProjektObjekteImDetail.php | 2 - app/Models/Projekte.php | 2 - bootstrap/cache/routes-v7.php | 205 ++++++------------ ...25_09_24_131440_create_projektes_table.php | 4 - ...170241_create_inhaltsverzeichnis_table.php | 4 +- ...reate_projekt_inhaltsverzeichnis_table.php | 4 +- database/seeders/InhaltsverzeichnisSeeder.php | 2 +- database/seeders/TestProjektSeeder.php | 4 +- resources/css/pdf-download.css | 3 +- resources/views/download/gutachten.blade.php | 80 ------- routes/web.php | 10 +- 36 files changed, 431 insertions(+), 635 deletions(-) delete mode 100644 app/Actions/Download/Excel.php delete mode 100644 app/Actions/Download/Gutachten.php delete mode 100644 app/Actions/Download/Nutzwerte.php create mode 100644 app/Actions/Generate/Excel.php delete mode 100644 app/Actions/Generate/Gutachten/Deckblatt.php rename app/Actions/Generate/{MakeGutachten.php => MakeParagraph6.php} (83%) delete mode 100644 app/Actions/Generate/Nutzwerte/ProjektAllgemeinflaechens.php create mode 100644 app/Actions/Generate/Pdf.php create mode 100644 app/Actions/Generate/Pdf/Deckblatt.php create mode 100644 app/Actions/Generate/Pdf/DigitaleSignatur.php rename app/Actions/Generate/{Gutachten => Pdf}/Inhalt.php (85%) rename app/Actions/Generate/{Gutachten => Pdf}/Platzhalter.php (82%) rename app/Actions/Generate/{Gutachten => Pdf}/Ueberschrift.php (91%) rename app/Actions/Generate/{Gutachten/AllgemeinTabelle.php => Tabellen/Allgemeinflaechen.php} (93%) rename app/Actions/Generate/{Gutachten/Paragraph6Tabelle.php => Tabellen/Paragraph6.php} (79%) delete mode 100644 resources/views/download/gutachten.blade.php diff --git a/app/Actions/Create/CreatePlatzhalter.php b/app/Actions/Create/CreatePlatzhalter.php index 331d6b0..fcbe510 100644 --- a/app/Actions/Create/CreatePlatzhalter.php +++ b/app/Actions/Create/CreatePlatzhalter.php @@ -2,6 +2,7 @@ namespace App\Actions\Create; +use App\Models\Projekte; use App\Models\ProjektInhaltsverzeichnis; use App\Models\ProjektPlatzhalter; @@ -22,15 +23,16 @@ class CreatePlatzhalter ProjektPlatzhalter::where('projekte_id', $record->id)->update(['controll' => true]); foreach ($_platzhalter as $platzhalter) { - $result = ProjektPlatzhalter::where('projekte_id', $record->id)->where('platzhalter', $platzhalter)->get(); - if ($result->count() == 0) { - $tmp = new ProjektPlatzhalter; - $tmp->projekte_id = $record->id; - $tmp->platzhalter = $platzhalter; - $tmp->controll = false; - $tmp->save(); - } + ProjektPlatzhalter::updateOrCreate( + ['projekte_id' => $record->id, 'platzhalter' => $platzhalter], + ['controll' => false] + ); } ProjektPlatzhalter::where('projekte_id', $record->id)->where('controll', true)->delete(); + + Projekte::where('id', $record->id)->update([ + 'evaluation_gutachten' => false, + 'pdf_nutzwerte_status' => false, + ]); } } diff --git a/app/Actions/Create/CreateProjektInhaltsverzeichnis.php b/app/Actions/Create/CreateProjektInhaltsverzeichnis.php index 4ed6367..5ce2dbd 100644 --- a/app/Actions/Create/CreateProjektInhaltsverzeichnis.php +++ b/app/Actions/Create/CreateProjektInhaltsverzeichnis.php @@ -12,39 +12,34 @@ class CreateProjektInhaltsverzeichnis { ProjektInhaltsverzeichnis::where('projekte_id', $record->id)->delete(); - $inhaltsverzeichnis = Inhaltsverzeichnis::get(); - $part = 1; - foreach ($inhaltsverzeichnis as $inhalt) { + $inhaltsverzeichnis = Inhaltsverzeichnis::orderBy('sort')->get(); + + foreach ($inhaltsverzeichnis as $key => $value) { + + $key++; $textblock = ''; - if ($inhalt->textblock_id > 0) { - $textblock = Textblock::where('id', $inhalt->textblock_id)->pluck('textblock')->first(); + if ($value->textblock_id > 0) { + $textblock = Textblock::where('id', $value->textblock_id)->pluck('textblock')->first(); } - if ($inhalt->tabellen_id == 5) { - $part = 2; - } + $inhalt = new ProjektInhaltsverzeichnis; + $inhalt->projekte_id = $record->id; + $inhalt->sort = $key; + $inhalt->ordnungszahl = $value->ordnungszahl; + $inhalt->name = $value->name; + $inhalt->name2 = $value->name2; + $inhalt->ueberschrift_anzeigen = $value->ueberschrift_anzeigen; + $inhalt->tabellen_id = $value->tabellen_id; + $inhalt->textblock_id = $value->textblock_id; + $inhalt->part = $value->part; + $inhalt->seite = $value->seite; + $inhalt->neue_seite = $value->neue_seite; + $inhalt->seitenzahl_anzeige = $value->seitenzahl_anzeige; + $inhalt->no_edit = $value->no_edit; + $inhalt->textblock = $textblock; + $inhalt->save(); - ProjektInhaltsverzeichnis::updateOrCreate( - [ - 'projekte_id' => $record->id, - 'name' => $inhalt->name, - ], - [ - 'sort' => $inhalt->sort, - 'ordnungszahl' => $inhalt->ordnungszahl, - 'name' => $inhalt->name, - 'name2' => $inhalt->name2, - 'ueberschrift_anzeigen' => $inhalt->ueberschrift_anzeigen, - 'tabellen_id' => $inhalt->tabellen_id, - 'textblock_id' => $inhalt->textblock_id, - 'part' => $part, - 'seite' => $inhalt->seite, - 'neue_seite' => $inhalt->neue_seite, - 'seitenzahl_anzeige' => $inhalt->seitenzahl_anzeige, - 'no_edit' => $inhalt->no_edit, - 'textblock' => $textblock, - ]); } } } diff --git a/app/Actions/Download/Excel.php b/app/Actions/Download/Excel.php deleted file mode 100644 index bfef2b4..0000000 --- a/app/Actions/Download/Excel.php +++ /dev/null @@ -1,53 +0,0 @@ -update(['excel_nutzwerte' => '', 'excel_nutzwerte_ok' => '0']); - } - - $projekt = Projekt::where('id', $projekts_id)->first()->toArray(); - $filepath = Storage::disk('public')->path("/download/$projekts_id/excel/"); - - if ($projekt['excel_nutzwerte_ok'] == 0) { - - $filename = preg_replace("'[^0-9a-zA-Z]'", '', $projekt['intname']).'.xlsx'; - - if (! File::isDirectory($filepath)) { - File::makeDirectory($filepath, 0777, true, true); - } - $file = $filepath.$filename; - - GenerateExcel::generate($file, $projekts_id); - - Projekt::where('id', $projekts_id)->update(['excel_nutzwerte' => $filename, 'excel_nutzwerte_ok' => '1']); - - } else { - - $filename = $projekt['excel_nutzwerte']; - $file = $filepath.$filename; - } - - $headers = [ - 'Content-Type: application/vnd.ms-excel', - 'Content-Disposition: attachment;filename="'.$filename.'"', - 'Cache-Control: max-age=0', - 'Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT', - 'Cache-Control: cache, must-revalidate', - 'Pragma: public', - ]; - - return Response::download($file, $projekt['name'], $headers); - - } -} diff --git a/app/Actions/Download/Gutachten.php b/app/Actions/Download/Gutachten.php deleted file mode 100644 index 6bd7a06..0000000 --- a/app/Actions/Download/Gutachten.php +++ /dev/null @@ -1,64 +0,0 @@ -update(['pdf_gutachten_name' => '', 'pdf_gutachten_status' => '0']); - } - - $headers = [ - 'Content-Type: application/pdf', - 'Cache-Control: max-age=0', - 'Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT', - 'Cache-Control: cache, must-revalidate', - ]; - - $projekt = Projekte::where('id', $projekte_id)->first()->toArray(); - - $filepath = Storage::disk('public')->path("/download/$projekte_id/"); - - $filename = 'Gutachten '.preg_replace("'[^0-9a-zA-Z]'", '', $projekt['interner_name']).'.pdf'; - - if (! File::isDirectory($filepath)) { - File::makeDirectory($filepath, 0777, true, true); - } - $file = $filepath.$filename; - - MakeGutachten::generate($file, $projekte_id); - - return Response::download($file, 'Gutachten '.$projekt['offizieller_name'], $headers); - - // if ($projekt['pdf_standardtexte_ok'] == 0) { - - // $filename = preg_replace("'[^0-9a-zA-Z]'", '', $projekt['interner_name']).'.pdf'; - - // if (! File::isDirectory($filepath)) { - // File::makeDirectory($filepath, 0777, true, true); - // } - // $file = $filepath.$filename; - - // MakeGutachten::generate($file, $projekte_id); - - // Projekt::where('id', $projekte_id)->update(['pdf_standardtexte' => $filename, 'pdf_standardtexte_ok' => 1]); - - // return Response::download($file, $projekt['name'], $headers); - // } else { - - // $filename = $projekt['pdf_standardtexte']; - - // $file = $filepath.$filename; - - // return Response::download($file, $projekt['name'], $headers); - // } - } -} diff --git a/app/Actions/Download/Nutzwerte.php b/app/Actions/Download/Nutzwerte.php deleted file mode 100644 index 62eeefd..0000000 --- a/app/Actions/Download/Nutzwerte.php +++ /dev/null @@ -1,66 +0,0 @@ -update(['pdf_nutzwerte_name' => '', 'pdf_nutzwerte_status' => '0']); - } - - $headers = [ - 'Content-Type: application/pdf', - 'Cache-Control: max-age=0', - 'Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT', - 'Cache-Control: cache, must-revalidate', - ]; - - $projekt = Projekte::where('id', $projekte_id)->first()->toArray(); - - $filepath = Storage::disk('public')->path("/download/$projekte_id/"); - - $filename = 'Gutachten '.preg_replace("'[^0-9a-zA-Z]'", '', $projekt['interner_name']).'.pdf'; - - if (! File::isDirectory($filepath)) { - File::makeDirectory($filepath, 0777, true, true); - } - $file = $filepath.$filename; - - MakeNutzwerte::generate($file, $projekte_id); - - return Response::download($file, 'Nutzwert '.$projekt['offizieller_name'], $headers); - - // if ($projekt['pdf_nutzwerte_status'] == 0) { - - // $filename = preg_replace("'[^0-9a-zA-Z]'", '', $projekt['intname']).'.pdf'; - - // if (! File::isDirectory($filepath)) { - // File::makeDirectory($filepath, 0777, true, true); - // } - // $file = $filepath.$filename; - - // GenerateNutzwerte::generate($file, $projekte_id); - - // Projekte::where('id', $projekte_id)->update(['pdf_nutzwerte' => $filename, 'pdf_nutzwerte_ok' => '1']); - - // return Response::download($file, $projekt['name'], $headers); - - // } else { - - // $filename = $projekt['pdf_nutzwerte_name']; - - // $file = $filepath.$filename; - - // return Response::download($file, $projekt['name'], $headers); - // } - } -} diff --git a/app/Actions/Generate/Excel.php b/app/Actions/Generate/Excel.php new file mode 100644 index 0000000..e9cd503 --- /dev/null +++ b/app/Actions/Generate/Excel.php @@ -0,0 +1,13 @@ +boolean('logo_anzeigen')->default(0); - // $table->boolean('text_anzeigen')->default(0); - - // GUTACHTER - $html = '
'; - if (MakeGutachten::$gutachter->logo && MakeGutachten::$gutachter->logo_anzeigen) { - $html .= '
'; - } - if (MakeGutachten::$gutachter->referenz_formatting && MakeGutachten::$gutachter->text_anzeigen) { - $str = RichContentRenderer::make(MakeGutachten::$gutachter->referenz_formatting)->toHtml(); - $html .= Format::fix_str($str); - } - $html .= '
'; - - // PROJEKT - $html .= '
'; - $html .= '

Gutachten

'; - $html .= '
'.trim(MakeGutachten::$projekt->interner_name).'
'; - $html .= '
'; - - $html .= '
'; - $html .= '

ZUR FESTSETZUNG DER NUTZWERTE

'; - $html .= '
'.trim(MakeGutachten::$projekt->offizieller_name).'
'; - $html .= '
'.trim($textblock).'
'; - $html .= '
'; - - // AUFTRAGGEBER - $html .= '
'; - if (MakeGutachten::$auftraggeber->logo && MakeGutachten::$auftraggeber->logo_anzeigen) { - $html .= '
'; - } - if (MakeGutachten::$auftraggeber->referenz_formatting && MakeGutachten::$auftraggeber->text_anzeigen) { - $str = RichContentRenderer::make(MakeGutachten::$auftraggeber->referenz_formatting)->toHtml(); - $html .= Format::fix_str($str); - } - $html .= '
'; - - return $html; - } -} diff --git a/app/Actions/Generate/MakeNutzwerte.php b/app/Actions/Generate/MakeNutzwerte.php index e3008bb..4ece199 100644 --- a/app/Actions/Generate/MakeNutzwerte.php +++ b/app/Actions/Generate/MakeNutzwerte.php @@ -60,7 +60,7 @@ class MakeNutzwerte $mpdf->SetCreator('nutzwerte.at'); $mpdf->SetAuthor(self::$gutachter->title.' '.self::$gutachter->gender.' '.self::$gutachter->name); - $inhaltesverzeichnis = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->where('part', 2)->orderBy('sort')->get(); + $inhaltesverzeichnis = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->where('part', 'nutzwerte')->orderBy('sort')->get(); $platzhalter = ProjektPlatzhalter::where('projekte_id', $projekte_id)->pluck('platzhaltertext', 'platzhalter')->toArray(); diff --git a/app/Actions/Generate/MakeGutachten.php b/app/Actions/Generate/MakeParagraph6.php similarity index 83% rename from app/Actions/Generate/MakeGutachten.php rename to app/Actions/Generate/MakeParagraph6.php index 4bdcf32..5658a67 100644 --- a/app/Actions/Generate/MakeGutachten.php +++ b/app/Actions/Generate/MakeParagraph6.php @@ -2,23 +2,21 @@ namespace App\Actions\Generate; -use App\Actions\Generate\Gutachten\AllgemeinTabelle; use App\Actions\Generate\Gutachten\Deckblatt; -use App\Actions\Generate\Gutachten\Inhalt; -use App\Actions\Generate\Gutachten\Paragraph6Tabelle; use App\Actions\Generate\Gutachten\Platzhalter; use App\Actions\Generate\Gutachten\Ueberschrift; +use App\Actions\Generate\Nutzwerte\BerechnungNutzwerte; use App\Actions\Generate\Utilities\Format; +use App\Actions\ProcessData\ProcessRaumorientierung; use App\Models\Auftraggeber; use App\Models\Gutachter; use App\Models\Projekte; use App\Models\ProjektInhaltsverzeichnis; use App\Models\ProjektPlatzhalter; -use Filament\Forms\Components\RichEditor\RichContentRenderer; use Mpdf\HTMLParserMode; use Mpdf\Mpdf; -class MakeGutachten +class MakeParagraph6 { public static $projekt; @@ -28,6 +26,10 @@ class MakeGutachten public static function generate($filepath, $projekte_id) { + // ProcessRaumorientierung::berechnen($projekte_id); + // BerechnungNutzwerte::berechnen($projekte_id); + + // PDF START self::$projekt = Projekte::where('id', $projekte_id)->first(); self::$gutachter = Gutachter::where('id', self::$projekt->gutachter_id)->first(); @@ -41,22 +43,21 @@ class MakeGutachten 'debug' => true, 'mode' => 'utf-8', 'format' => 'A4-P', - 'margin_left' => 15, + 'margin_left' => 10, 'margin_right' => 10, - 'margin_top' => 10, - 'margin_bottom' => 10, + 'margin_top' => 12, + 'margin_bottom' => 20, 'margin_header' => 0, 'margin_footer' => 0, ] ); - $stylesheet = file_get_contents(__DIR__.'/../../../resources/css/pdf-download.css'); $mpdf->WriteHTML($stylesheet, HTMLParserMode::HEADER_CSS); - $mpdf->SetTitle('Gutachten '.self::$projekt->offizieller_name); + $mpdf->SetTitle('Nutzwerte '.self::$projekt->offizieller_name); $mpdf->SetCreator('nutzwerte.at'); $mpdf->SetAuthor(self::$gutachter->title.' '.self::$gutachter->gender.' '.self::$gutachter->name); - $inhaltesverzeichnis = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->where('part', 1)->orderBy('sort')->get(); + $inhaltesverzeichnis = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->where('part', 'paragraph')->orderBy('sort')->get(); $platzhalter = ProjektPlatzhalter::where('projekte_id', $projekte_id)->pluck('platzhaltertext', 'platzhalter')->toArray(); @@ -91,7 +92,7 @@ class MakeGutachten $html .= AllgemeinTabelle::load($projekte_id); break; case '8': - $str = RichContentRenderer::make(MakeGutachten::$auftraggeber->referenz_formatting)->toHtml(); + $str = RichContentRenderer::make(MakeStandardTexte::$auftraggeber->referenz_formatting)->toHtml(); $html .= Format::fix_str($str); break; } diff --git a/app/Actions/Generate/Nutzwerte/ProjektAllgemeinflaechens.php b/app/Actions/Generate/Nutzwerte/ProjektAllgemeinflaechens.php deleted file mode 100644 index 12785f9..0000000 --- a/app/Actions/Generate/Nutzwerte/ProjektAllgemeinflaechens.php +++ /dev/null @@ -1,47 +0,0 @@ -'; - $html .= ''; - $html .= Html::td('Top', 'head bl bt bb'); - $html .= Html::td('Raumart', 'head bl bt bb'); - $html .= Html::td('Fläche', 'head center bl bt bb'); - $html .= Html::td('', 'bl'); - $html .= Html::td('Top', 'head bb bt bl'); - $html .= Html::td('Type', 'head bt bl bb'); - $html .= Html::td('Fläche', 'head center bl bt bb br'); - $html .= ''; - - $res = ProjektAllgemeinflaechen::select('geschoss', 'raumart', 'qm')->where('projekts_id', $projekts_id)->orderBy('geschoss')->orderBy('raumart')->get(); - - foreach ($res as $key => $allg) { - $bg = ($key % 4 == 2 || $key % 4 == 3) ? 'hellgrau' : ''; - if ($key % 2 == 0) { - $html .= ''; - $html .= Html::td($allg->geschoss, "bl bb br $bg"); - $html .= Html::td($allg->raumart, "bb br $bg"); - $html .= Html::td(Format::numeric($allg->qm, 2), "center bb br $bg"); - $html .= Html::td(''); - } else { - $html .= Html::td($allg->geschoss, "bl bb br $bg"); - $html .= Html::td($allg->raumart, "bb br $bg"); - $html .= Html::td(Format::numeric($allg->qm, 2), "center bb br $bg"); - $html .= ''; - } - } - - $html .= ''; - - return $html; - } -} diff --git a/app/Actions/Generate/Nutzwerte/ZuUndAbschlaege.php b/app/Actions/Generate/Nutzwerte/ZuUndAbschlaege.php index a06b9de..67f58e5 100644 --- a/app/Actions/Generate/Nutzwerte/ZuUndAbschlaege.php +++ b/app/Actions/Generate/Nutzwerte/ZuUndAbschlaege.php @@ -2,11 +2,11 @@ namespace App\Actions\Generate\Nutzwerte; +use App\Actions\Generate\Utilities\Format; +use App\Actions\Generate\Utilities\Html; use App\Models\Merkmale; use App\Models\ProjektMethode; use App\Models\ProjektObjekte; -use App\Actions\Generate\Utilities\Html; -use App\Actions\Generate\Utilities\Format; class ZuUndAbschlaege { @@ -21,16 +21,13 @@ class ZuUndAbschlaege ->get() ->toArray(); - $has_loggien = ProjektMethode::where('projekte_id', $projekte_id)->where('methode_id', 2)->count(); - if($has_loggien){ + if ($has_loggien) { $header_row = ['Top Nummer', 'Geschoß', 'Typ', 'Nutzfläche', 'Loggia / Zusatzflächen', 'Gesamtnutzfläche']; - } - else{ + } else { $header_row = ['Top Nummer', 'Geschoß', 'Typ', 'Nutzfläche']; } - $merkmale = Merkmale::where('projekte_id', $projekte_id)->pluck('name', 'code'); @@ -74,7 +71,7 @@ class ZuUndAbschlaege foreach ($markmale_codes as $code) { $html .= Html::td($objekt[$code], 'center br bb'); } - $html .= Html::td(Format::dezimal($objekt['nutzwert'],2), 'center br bb'); + $html .= Html::td(Format::dezimal($objekt['nutzwert'], 2), 'center br bb'); $html .= Html::td(Format::dezimal(100 + $objekt['nutzwert'], 2), 'right br bb'); $html .= ''; } diff --git a/app/Actions/Generate/Pdf.php b/app/Actions/Generate/Pdf.php new file mode 100644 index 0000000..9c06434 --- /dev/null +++ b/app/Actions/Generate/Pdf.php @@ -0,0 +1,144 @@ +first(); + + self::$gutachter = Gutachter::where('id', self::$projekt->gutachter_id)->first(); + + self::$auftraggeber = Auftraggeber::where('id', self::$projekt->auftraggeber_id)->first(); + + $headers = [ + 'Content-Type: application/pdf', + 'Cache-Control: max-age=0', + 'Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT', + 'Cache-Control: cache, must-revalidate', + ]; + + $filepath = Storage::disk('public')->path("/download/$projekte_id/"); + $filename = \ucfirst($type).' '.preg_replace("'[^0-9a-zA-Z]'", '', self::$projekt->interner_name).'.pdf'; + + if ($type == 'nutzwerte') { + if ($mode == 'new') { + Projekte::where('id', $projekte_id)->update(['pdf_gutachten_name' => '', 'pdf_nutzwerte_status' => 1]); + } else { + return Response::download($file, $filename, $headers); + } + } + + if (! File::isDirectory($filepath)) { + File::makeDirectory($filepath, 0777, true, true); + } + $file = $filepath.$filename; + + ob_start(); + + $mpdf = new Mpdf( + [ + 'debug' => true, + 'mode' => 'utf-8', + 'format' => 'A4-P', + 'margin_left' => 10, + 'margin_right' => 10, + 'margin_top' => 12, + 'margin_bottom' => 20, + 'margin_header' => 0, + 'margin_footer' => 0, + ] + ); + $stylesheet = file_get_contents(__DIR__.'/../../../resources/css/pdf-download.css'); + $mpdf->WriteHTML($stylesheet, HTMLParserMode::HEADER_CSS); + $mpdf->SetTitle($filename); + $mpdf->SetCreator('nutzwerte.at'); + $mpdf->SetAuthor(self::$gutachter->title.' '.self::$gutachter->gender.' '.self::$gutachter->name); + + $inhaltesverzeichnis = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->where('part', $type)->orderBy('sort')->get(); + + $platzhalter = ProjektPlatzhalter::where('projekte_id', $projekte_id)->pluck('platzhaltertext', 'platzhalter')->toArray(); + + foreach ($inhaltesverzeichnis as $inhalt) { + + if ($inhalt->neue_seite) { + $mpdf->AddPage(); + } + + if ($inhalt->textblock) { + $textblock = Platzhalter::replace($platzhalter, $inhalt->textblock); + $textblock = Format::fix_str($textblock); + } + + $html = Ueberschrift::create($inhalt); + + if ($inhalt->name == 'DECKBLATT') { + $html .= Deckblatt::create($textblock); + } elseif ($inhalt->name == 'INHALTSVERZEICHNIS') { + $html .= Inhalt::create($projekte_id); + } else { + + if ($inhalt->textblock) { + $html .= $textblock; + } + + switch ($inhalt->tabellen_id) { + case '3': + $html .= Paragraph6::load($projekte_id); + break; + case '4': + $html .= Allgemeinflaechen::load($projekte_id); + break; + case '8': + $str = RichContentRenderer::make(self::$auftraggeber->referenz_formatting)->toHtml(); + $html .= Format::fix_str($str); + break; + case '11': + $html .= DigitaleSignatur::load($projekte_id); + break; + } + } + + if ($inhalt->seitenzahl_anzeige == 1) { + $mpdf->SetHTMLFooter('
Seite {PAGENO}

'); + } + if ($html) { + $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY); + } + } + + ob_clean(); + + $mpdf->Output($file, 'F'); + + return Response::download($file, $filename, $headers); + } +} diff --git a/app/Actions/Generate/Pdf/Deckblatt.php b/app/Actions/Generate/Pdf/Deckblatt.php new file mode 100644 index 0000000..26a6056 --- /dev/null +++ b/app/Actions/Generate/Pdf/Deckblatt.php @@ -0,0 +1,49 @@ +'; + if (Pdf::$gutachter->logo && Pdf::$gutachter->logo_anzeigen) { + $html .= '
'; + } + if (Pdf::$gutachter->referenz_formatting && Pdf::$gutachter->text_anzeigen) { + $str = RichContentRenderer::make(Pdf::$gutachter->referenz_formatting)->toHtml(); + $html .= Format::fix_str($str); + } + $html .= ''; + + // PROJEKT + $html .= '
'; + $html .= '

Gutachten

'; + $html .= '
'.trim(Pdf::$projekt->interner_name).'
'; + $html .= '
'; + + $html .= '
'; + $html .= '

ZUR FESTSETZUNG DER NUTZWERTE

'; + $html .= '
'.trim(Pdf::$projekt->offizieller_name).'
'; + $html .= '
'.trim($textblock).'
'; + $html .= '
'; + + // AUFTRAGGEBER + $html .= '
'; + if (Pdf::$auftraggeber->logo && Pdf::$auftraggeber->logo_anzeigen) { + $html .= '
'; + } + if (Pdf::$auftraggeber->referenz_formatting && Pdf::$auftraggeber->text_anzeigen) { + $str = RichContentRenderer::make(Pdf::$auftraggeber->referenz_formatting)->toHtml(); + $html .= Format::fix_str($str); + } + $html .= '
'; + + return $html; + } +} diff --git a/app/Actions/Generate/Pdf/DigitaleSignatur.php b/app/Actions/Generate/Pdf/DigitaleSignatur.php new file mode 100644 index 0000000..8b5af2a --- /dev/null +++ b/app/Actions/Generate/Pdf/DigitaleSignatur.php @@ -0,0 +1,13 @@ +digitale_signatur_stempel.'\');">'; + } +} diff --git a/app/Actions/Generate/Gutachten/Inhalt.php b/app/Actions/Generate/Pdf/Inhalt.php similarity index 85% rename from app/Actions/Generate/Gutachten/Inhalt.php rename to app/Actions/Generate/Pdf/Inhalt.php index b21582f..c683867 100644 --- a/app/Actions/Generate/Gutachten/Inhalt.php +++ b/app/Actions/Generate/Pdf/Inhalt.php @@ -1,6 +1,6 @@ '; $inhalte = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->orderBy('sort')->get(); foreach ($inhalte as $inhalt) { - if ($inhalt->ueberschrift_anzeigen) { + if ($inhalt->name != 'INHALTSVERZEICHNIS' && $inhalt->ueberschrift_anzeigen) { $html .= ''; $html .= Html::td(Format::index($inhalt->ordnungszahl)); $html .= Html::td($inhalt->name); diff --git a/app/Actions/Generate/Gutachten/Platzhalter.php b/app/Actions/Generate/Pdf/Platzhalter.php similarity index 82% rename from app/Actions/Generate/Gutachten/Platzhalter.php rename to app/Actions/Generate/Pdf/Platzhalter.php index b6fdc48..ae0a91f 100644 --- a/app/Actions/Generate/Gutachten/Platzhalter.php +++ b/app/Actions/Generate/Pdf/Platzhalter.php @@ -1,6 +1,6 @@ '; + $html = ''; $html .= ''; $html .= ''; $html .= Html::td('Geschoß', 'head bl bt wp10'); diff --git a/app/Actions/Generate/Gutachten/Paragraph6Tabelle.php b/app/Actions/Generate/Tabellen/Paragraph6.php similarity index 79% rename from app/Actions/Generate/Gutachten/Paragraph6Tabelle.php rename to app/Actions/Generate/Tabellen/Paragraph6.php index 9b60c26..5879ba7 100644 --- a/app/Actions/Generate/Gutachten/Paragraph6Tabelle.php +++ b/app/Actions/Generate/Tabellen/Paragraph6.php @@ -1,16 +1,17 @@ with('projektobjekteimdetail') ->where('projekte_id', $projekte_id) ->orderBy('nicht_in_orientierung') ->orderBy('top_nummer') @@ -30,8 +31,8 @@ class Paragraph6Tabelle $html .= ''; $html .= Html::td($value->top_nummer, 'center br bb'); - $html .= Html::td($value->geschoss, 'center br bb'); - $html .= Html::td($value->orientierung->name ?? '', 'center br bb'); + $html .= Html::td($value->projektobjekteimdetail?->geschoss, 'center br bb'); + $html .= Html::td($value->orientierung?->name, 'center br bb'); $html .= Html::td($value->type, 'center br bb'); $html .= ''; } diff --git a/app/Actions/Validation/GutachtenValidation.php b/app/Actions/Validation/GutachtenValidation.php index 04803f2..5f95194 100644 --- a/app/Actions/Validation/GutachtenValidation.php +++ b/app/Actions/Validation/GutachtenValidation.php @@ -2,6 +2,7 @@ namespace App\Actions\Validation; +use App\Models\Gutachter; use App\Models\ProjektAllgemeinflaechen; use App\Models\Projekte; use App\Models\ProjektInhaltsverzeichnis; @@ -15,6 +16,27 @@ class GutachtenValidation { public static function controll($record) { + /** + * Projekt + */ + $pro = Projekte::where('id', $record->id)->first(); + + /** + * Gutachter + */ + $res = Gutachter::where('konto_id', auth()->user()->konto_id)->where('id', $pro->gutachter_id)->first(); + if (! $res->digitale_signatur_stempel) { + Notification::make() + ->title('Gutacher') + ->info() + ->icon('heroicon-o-exclamation-triangle') + ->duration(10000) + ->body('Es fehlt der Stempel für die Digitale Signatur.') + ->send(); + + return false; + } + /** * ProjektAllgemeinflaechen */ diff --git a/app/Filament/Resources/Gutachters/Tables/GutachtersTable.php b/app/Filament/Resources/Gutachters/Tables/GutachtersTable.php index bc27e51..defaa80 100644 --- a/app/Filament/Resources/Gutachters/Tables/GutachtersTable.php +++ b/app/Filament/Resources/Gutachters/Tables/GutachtersTable.php @@ -18,6 +18,10 @@ class GutachtersTable // TextColumn::make('gender')->label('Geschlecht'), // TextColumn::make('title')->label('Title'), // TextColumn::make('name')->searchable(), + ImageColumn::make('digitale_signatur_stempel') + ->alignCenter() + ->label('Digitale Signatur') + ->disk('public'), TextColumn::make('email')->copyable()->label('E-Mail')->searchable(), ]) ->recordActions([ diff --git a/app/Filament/Resources/Projektes/Pages/EditProjekte.php b/app/Filament/Resources/Projektes/Pages/EditProjekte.php index d0a4634..2bb714a 100644 --- a/app/Filament/Resources/Projektes/Pages/EditProjekte.php +++ b/app/Filament/Resources/Projektes/Pages/EditProjekte.php @@ -95,7 +95,7 @@ class EditProjekte extends EditRecord ->fileRules([ File::types(['csv', 'txt'])->max(1024), ]), - ])->label('Importieren') + ])->label('Import') ->icon('phosphor-upload') ->color('info') ->button(), @@ -141,7 +141,6 @@ class EditProjekte extends EditRecord */ 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 { @@ -150,69 +149,64 @@ class EditProjekte extends EditRecord }), /** - * BERECHNEN + * PDF */ ActionGroup::make([ - Action::make('make_gutachten') - ->hidden(fn ($record): bool => (! $record->bezahlt_am || $record->pdf_gutachten_status || ! $record->evaluation_gutachten) ? true : false) + /** + * STANDART TEXT + */ + Action::make('make-standard') + ->hidden(fn ($record): bool => (! $record->bezahlt_am || ! $record->evaluation_gutachten) ? true : false) ->label('Standard Texte') - ->icon('phosphor-calculator') - ->url(fn ($record) => route('standard.download', ['record' => $record, 'mode' => 'new'])) + ->icon('icon-pdf') + ->url(fn ($record) => route('pdf', ['record' => $record, 'type' => 'standard', 'mode' => 'new'])) ->openUrlInNewTab(), /** * NUTZWERTE */ - Action::make('make_nutzwerte') + Action::make('make-nutzwerte') ->hidden(fn ($record): bool => (! $record->bezahlt_am || $record->pdf_nutzwerte_status || ! $record->evaluation_gutachten) ? true : false) - ->label('Nutzwerte') + ->label('Nutzwerte Berechnen') ->icon('phosphor-calculator') - ->url(fn ($record) => route('nutzwerte.download', ['record' => $record, 'mode' => 'new'])) + ->url(fn ($record) => route('pdf', ['record' => $record, 'type' => 'nutzwerte', 'mode' => 'new'])) ->openUrlInNewTab(), - ])->label('Berechnen') - ->icon('phosphor-calculator') + Action::make('make-nutzwerte') + ->hidden(fn ($record): bool => (! $record->bezahlt_am || ! $record->pdf_nutzwerte_status || ! $record->evaluation_gutachten) ? true : false) + ->label('Nutzwerte') + ->icon('icon-pdf') + ->url(fn ($record) => route('pdf', ['record' => $record, 'type' => 'nutzwerte', 'mode' => 'file'])) + ->openUrlInNewTab(), + /** + * PARAGRAPH 6 + */ + Action::make('make-paragraph') + ->hidden(fn ($record): bool => (! $record->bezahlt_am || ! $record->evaluation_gutachten) ? true : false) + ->label('Auszug gem. §6 ') + ->icon('icon-pdf') + ->url(fn ($record) => route('pdf', ['record' => $record, 'type' => 'paragraph', 'mode' => 'new'])) + ->openUrlInNewTab(), + ])->label('Pdf') + ->icon('phosphor-download') ->color('info') ->button(), /** - * DOWNLOAD + * EXCEL */ ActionGroup::make([ - /** - * GUTACHTEN - */ - Action::make('download-gutachten') - ->hidden(fn ($record): bool => (! $record->bezahlt_am || ! $record->pdf_gutachten_status) ? true : false) - ->color('success') - ->label('Download Gutachten') - ->icon('icon-pdf') - ->url(fn ($record) => route('standard.download', ['record' => $record, 'mode' => 'file'])) - ->openUrlInNewTab(), - /** - * NUTZWERTE - */ - Action::make('download-nutzwerte') - ->hidden(fn ($record): bool => (! $record->bezahlt_am || ! $record->pdf_nutzwerte_status) ? true : false) - ->color('success') - ->label('Download Nutzwerte') - ->icon('icon-pdf') - ->url(fn ($record) => route('nutzwerte.download', ['record' => $record, 'mode' => 'file'])) - ->openUrlInNewTab(), - /** - * EXCEL - */ - Action::make('excel-nutzflaeche-nutzwerte') + Action::make('excel-nutzwerte') ->label('Nutzfläche & Nutzwerte') ->icon('icon-excel') - ->url(fn ($record) => route('excel.download', ['record' => $record, 'mode' => 'file'])) + ->url(fn ($record) => route('excel', ['record' => $record, 'type' => 'excel-nutzwerte'])) ->hidden(fn ($record): bool => (! $record->bezahlt_am || ! $record->evaluation_gutachten) ? true : false) ->openUrlInNewTab(), - Action::make('excel-nutzflaechen-aufstellung') + Action::make('excel-aufstellung') ->label('Nutzflächen Aufstellung') ->icon('icon-excel') - ->url(fn ($record) => route('excel.download', ['record' => $record, 'mode' => 'file'])) + ->url(fn ($record) => route('excel', ['record' => $record, 'type' => 'excel-aufstellung'])) ->hidden(fn ($record): bool => (! $record->bezahlt_am || ! $record->evaluation_gutachten) ? true : false) ->openUrlInNewTab(), - ])->label('Export') + ])->label('Excel') ->icon('phosphor-download') ->color('info') ->button(), diff --git a/app/Models/ProjektAllgemeinflaechen.php b/app/Models/ProjektAllgemeinflaechen.php index dea24d1..ba73ea8 100644 --- a/app/Models/ProjektAllgemeinflaechen.php +++ b/app/Models/ProjektAllgemeinflaechen.php @@ -21,8 +21,6 @@ class ProjektAllgemeinflaechen extends Model Projekte::where('id', $model['projekte_id'])->update([ 'evaluation_gutachten' => false, 'pdf_nutzwerte_status' => false, - 'pdf_gutachten_status' => false, - 'excel_nutzwerte_status' => false, ]); }); } diff --git a/app/Models/ProjektMethode.php b/app/Models/ProjektMethode.php index 7b94c22..5a900d8 100644 --- a/app/Models/ProjektMethode.php +++ b/app/Models/ProjektMethode.php @@ -22,8 +22,6 @@ class ProjektMethode extends Model Projekte::where('id', $model['projekte_id'])->update([ 'evaluation_gutachten' => false, 'pdf_nutzwerte_status' => false, - 'pdf_gutachten_status' => false, - 'excel_nutzwerte_status' => false, ]); }); } diff --git a/app/Models/ProjektObjekte.php b/app/Models/ProjektObjekte.php index 652a1a7..e876e42 100644 --- a/app/Models/ProjektObjekte.php +++ b/app/Models/ProjektObjekte.php @@ -3,7 +3,6 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; class ProjektObjekte extends Model @@ -36,8 +35,6 @@ class ProjektObjekte extends Model Projekte::where('id', $model['projekte_id'])->update([ 'evaluation_gutachten' => false, 'pdf_nutzwerte_status' => false, - 'pdf_gutachten_status' => false, - 'excel_nutzwerte_status' => false, ]); }); } @@ -59,8 +56,8 @@ class ProjektObjekte extends Model return $this->hasOne(Orientierung::class, 'id', 'orientierung_id'); } - public function projektobjekteimdetail(): HasMany + public function projektobjekteimdetail(): HasOne { - return $this->hasMany(ProjektObjekteImDetail::class, 'projekt_objekte_id', 'id'); + return $this->hasOne(ProjektObjekteImDetail::class, 'projekt_objekte_id', 'id'); } } diff --git a/app/Models/ProjektObjekteImDetail.php b/app/Models/ProjektObjekteImDetail.php index f117bf9..7fc09ac 100644 --- a/app/Models/ProjektObjekteImDetail.php +++ b/app/Models/ProjektObjekteImDetail.php @@ -26,8 +26,6 @@ class ProjektObjekteImDetail extends Model Projekte::where('id', $model['projekte_id'])->update([ 'evaluation_gutachten' => false, 'pdf_nutzwerte_status' => false, - 'pdf_gutachten_status' => false, - 'excel_nutzwerte_status' => false, ]); }); } diff --git a/app/Models/Projekte.php b/app/Models/Projekte.php index b0ecf44..871718a 100644 --- a/app/Models/Projekte.php +++ b/app/Models/Projekte.php @@ -33,8 +33,6 @@ class Projekte extends Model return [ 'bezahlt_am' => 'datetime', 'pdf_nutzwerte_status' => 'boolean', - 'pdf_gutachten_status' => 'boolean', - 'excel_nutzwerte_status' => 'boolean', 'evaluation_gutachten' => 'boolean', ]; } diff --git a/bootstrap/cache/routes-v7.php b/bootstrap/cache/routes-v7.php index 85f2c99..4e911b9 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::PwdMlIbAzySZ2HRI', + '_route' => 'generated::tiUv4rvgBcNvkvtY', ), 1 => NULL, 2 => @@ -551,7 +551,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::N8CSCM7r6TovEThh', + '_route' => 'generated::8p53Iz2lUpOvF7no', ), 1 => NULL, 2 => @@ -609,7 +609,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::DvHblY3D9jC5CBEr', + '_route' => 'generated::lz7Zg8blMDT4P8Jk', ), 1 => NULL, 2 => @@ -629,7 +629,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::tuYe8VlROb72rAJE', + '_route' => 'generated::8d1F1ZEUsjVSMeYc', ), 1 => NULL, 2 => @@ -649,7 +649,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::bwcBReHemyUQXHvS', + '_route' => 'generated::m4g7KkpOJaRLv9Qh', ), 1 => NULL, 2 => @@ -669,7 +669,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::5RQqVjnY9GRCSgNQ', + '_route' => 'generated::DPRLZjl4pLkhWpMc', ), 1 => NULL, 2 => @@ -689,7 +689,7 @@ app('router')->setCompiledRoutes( array ( 0 => array ( - '_route' => 'generated::Qc3TrVdDmpobltpq', + '_route' => 'generated::MOt3vLAjE2hdhyas', ), 1 => NULL, 2 => @@ -706,7 +706,7 @@ app('router')->setCompiledRoutes( ), 2 => array ( - 0 => '{^(?|/filament/(?|exports/([^/]++)/download(*:45)|imports/([^/]++)/failed\\-rows/download(*:90))|/app/(?|e(?|mail\\-(?|verification/verify/([^/]++)/([^/]++)(*:156)|change\\-verification/verify/([^/]++)/([^/]++)(?|(*:212)|/block(*:226)))|xcel/([^/]++)/([^/]++)/download(*:267))|projektes/([^/]++)/edit(*:299)|administration/shield/roles/([^/]++)(?|(*:346)|/edit(*:359))|nutzwerte/([^/]++)/([^/]++)/download(*:404)|standard/([^/]++)/([^/]++)/download(*:447))|/livewire/preview\\-file/([^/]++)(*:488)|/storage/(.*)(*:509))/?$}sDu', + 0 => '{^(?|/filament/(?|exports/([^/]++)/download(*:45)|imports/([^/]++)/failed\\-rows/download(*:90))|/app/(?|e(?|mail\\-(?|verification/verify/([^/]++)/([^/]++)(*:156)|change\\-verification/verify/([^/]++)/([^/]++)(?|(*:212)|/block(*:226)))|xcel/([^/]++)/([^/]++)(*:258))|p(?|rojektes/([^/]++)/edit(*:293)|df/([^/]++)/([^/]++)/([^/]++)(*:330))|administration/shield/roles/([^/]++)(?|(*:378)|/edit(*:391)))|/livewire/preview\\-file/([^/]++)(*:433)|/storage/(.*)(*:454))/?$}sDu', ), 3 => array ( @@ -828,18 +828,18 @@ app('router')->setCompiledRoutes( 6 => NULL, ), ), - 267 => + 258 => array ( 0 => array ( 0 => array ( - '_route' => 'excel.download', + '_route' => 'excel', ), 1 => array ( 0 => 'record', - 1 => 'mode', + 1 => 'type', ), 2 => array ( @@ -848,11 +848,11 @@ app('router')->setCompiledRoutes( ), 3 => NULL, 4 => false, - 5 => false, + 5 => true, 6 => NULL, ), ), - 299 => + 293 => array ( 0 => array ( @@ -875,7 +875,32 @@ app('router')->setCompiledRoutes( 6 => NULL, ), ), - 346 => + 330 => + array ( + 0 => + array ( + 0 => + array ( + '_route' => 'pdf', + ), + 1 => + array ( + 0 => 'record', + 1 => 'type', + 2 => 'mode', + ), + 2 => + array ( + 'GET' => 0, + 'HEAD' => 1, + ), + 3 => NULL, + 4 => false, + 5 => true, + 6 => NULL, + ), + ), + 378 => array ( 0 => array ( @@ -898,7 +923,7 @@ app('router')->setCompiledRoutes( 6 => NULL, ), ), - 359 => + 391 => array ( 0 => array ( @@ -921,55 +946,7 @@ app('router')->setCompiledRoutes( 6 => NULL, ), ), - 404 => - array ( - 0 => - array ( - 0 => - array ( - '_route' => 'nutzwerte.download', - ), - 1 => - array ( - 0 => 'record', - 1 => 'mode', - ), - 2 => - array ( - 'GET' => 0, - 'HEAD' => 1, - ), - 3 => NULL, - 4 => false, - 5 => false, - 6 => NULL, - ), - ), - 447 => - array ( - 0 => - array ( - 0 => - array ( - '_route' => 'standard.download', - ), - 1 => - array ( - 0 => 'record', - 1 => 'mode', - ), - 2 => - array ( - 'GET' => 0, - 'HEAD' => 1, - ), - 3 => NULL, - 4 => false, - 5 => false, - 6 => NULL, - ), - ), - 488 => + 433 => array ( 0 => array ( @@ -992,7 +969,7 @@ app('router')->setCompiledRoutes( 6 => NULL, ), ), - 509 => + 454 => array ( 0 => array ( @@ -2740,7 +2717,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::PwdMlIbAzySZ2HRI' => + 'generated::tiUv4rvgBcNvkvtY' => array ( 'methods' => array ( @@ -2752,7 +2729,7 @@ app('router')->setCompiledRoutes( array ( 'uses' => 'Livewire\\Mechanisms\\FrontendAssets\\FrontendAssets@returnJavaScriptAsFile', 'controller' => 'Livewire\\Mechanisms\\FrontendAssets\\FrontendAssets@returnJavaScriptAsFile', - 'as' => 'generated::PwdMlIbAzySZ2HRI', + 'as' => 'generated::tiUv4rvgBcNvkvtY', ), 'fallback' => false, 'defaults' => @@ -2768,7 +2745,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::N8CSCM7r6TovEThh' => + 'generated::8p53Iz2lUpOvF7no' => array ( 'methods' => array ( @@ -2780,7 +2757,7 @@ app('router')->setCompiledRoutes( array ( 'uses' => 'Livewire\\Mechanisms\\FrontendAssets\\FrontendAssets@maps', 'controller' => 'Livewire\\Mechanisms\\FrontendAssets\\FrontendAssets@maps', - 'as' => 'generated::N8CSCM7r6TovEThh', + 'as' => 'generated::8p53Iz2lUpOvF7no', ), 'fallback' => false, 'defaults' => @@ -2882,7 +2859,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::DvHblY3D9jC5CBEr' => + 'generated::lz7Zg8blMDT4P8Jk' => array ( 'methods' => array ( @@ -2910,8 +2887,8 @@ app('router')->setCompiledRoutes( return response(\\Illuminate\\Support\\Facades\\View::file(\'/Users/hermanntelser/Sites/nutzwerte_fi4/vendor/laravel/framework/src/Illuminate/Foundation/Configuration\'.\'/../resources/health-up.blade.php\', [ \'exception\' => $exception, ]), status: $exception ? 500 : 200); - }";s:5:"scope";s:54:"Illuminate\\Foundation\\Configuration\\ApplicationBuilder";s:4:"this";N;s:4:"self";s:32:"0000000000000f420000000000000000";}}', - 'as' => 'generated::DvHblY3D9jC5CBEr', + }";s:5:"scope";s:54:"Illuminate\\Foundation\\Configuration\\ApplicationBuilder";s:4:"this";N;s:4:"self";s:32:"0000000000000f400000000000000000";}}', + 'as' => 'generated::lz7Zg8blMDT4P8Jk', ), 'fallback' => false, 'defaults' => @@ -2927,7 +2904,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::tuYe8VlROb72rAJE' => + 'generated::8d1F1ZEUsjVSMeYc' => array ( 'methods' => array ( @@ -2943,13 +2920,13 @@ app('router')->setCompiledRoutes( ), 'uses' => 'O:55:"Laravel\\SerializableClosure\\UnsignedSerializableClosure":1:{s:12:"serializable";O:46:"Laravel\\SerializableClosure\\Serializers\\Native":5:{s:3:"use";a:0:{}s:8:"function";s:50:"function () { return \\view(\'pages.welcome\'); -}";s:5:"scope";s:37:"Illuminate\\Routing\\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"0000000000000f490000000000000000";}}', +}";s:5:"scope";s:37:"Illuminate\\Routing\\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"0000000000000f470000000000000000";}}', 'namespace' => NULL, 'prefix' => '', 'where' => array ( ), - 'as' => 'generated::tuYe8VlROb72rAJE', + 'as' => 'generated::8d1F1ZEUsjVSMeYc', ), 'fallback' => false, 'defaults' => @@ -2965,7 +2942,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::bwcBReHemyUQXHvS' => + 'generated::m4g7KkpOJaRLv9Qh' => array ( 'methods' => array ( @@ -2981,13 +2958,13 @@ app('router')->setCompiledRoutes( ), 'uses' => 'O:55:"Laravel\\SerializableClosure\\UnsignedSerializableClosure":1:{s:12:"serializable";O:46:"Laravel\\SerializableClosure\\Serializers\\Native":5:{s:3:"use";a:0:{}s:8:"function";s:52:"function () { return \\view(\'pages.nutzwerte\'); -}";s:5:"scope";s:37:"Illuminate\\Routing\\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"0000000000000f4b0000000000000000";}}', +}";s:5:"scope";s:37:"Illuminate\\Routing\\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"0000000000000f490000000000000000";}}', 'namespace' => NULL, 'prefix' => '', 'where' => array ( ), - 'as' => 'generated::bwcBReHemyUQXHvS', + 'as' => 'generated::m4g7KkpOJaRLv9Qh', ), 'fallback' => false, 'defaults' => @@ -3003,7 +2980,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::5RQqVjnY9GRCSgNQ' => + 'generated::DPRLZjl4pLkhWpMc' => array ( 'methods' => array ( @@ -3019,13 +2996,13 @@ app('router')->setCompiledRoutes( ), 'uses' => 'O:55:"Laravel\\SerializableClosure\\UnsignedSerializableClosure":1:{s:12:"serializable";O:46:"Laravel\\SerializableClosure\\Serializers\\Native":5:{s:3:"use";a:0:{}s:8:"function";s:51:"function () { return \\view(\'pages.programm\'); -}";s:5:"scope";s:37:"Illuminate\\Routing\\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"0000000000000f4d0000000000000000";}}', +}";s:5:"scope";s:37:"Illuminate\\Routing\\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"0000000000000f4b0000000000000000";}}', 'namespace' => NULL, 'prefix' => '', 'where' => array ( ), - 'as' => 'generated::5RQqVjnY9GRCSgNQ', + 'as' => 'generated::DPRLZjl4pLkhWpMc', ), 'fallback' => false, 'defaults' => @@ -3041,7 +3018,7 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'generated::Qc3TrVdDmpobltpq' => + 'generated::MOt3vLAjE2hdhyas' => array ( 'methods' => array ( @@ -3057,13 +3034,13 @@ app('router')->setCompiledRoutes( ), 'uses' => 'O:55:"Laravel\\SerializableClosure\\UnsignedSerializableClosure":1:{s:12:"serializable";O:46:"Laravel\\SerializableClosure\\Serializers\\Native":5:{s:3:"use";a:0:{}s:8:"function";s:52:"function () { return \\view(\'pages.impressum\'); -}";s:5:"scope";s:37:"Illuminate\\Routing\\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"0000000000000f4f0000000000000000";}}', +}";s:5:"scope";s:37:"Illuminate\\Routing\\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"0000000000000f4d0000000000000000";}}', 'namespace' => NULL, 'prefix' => '', 'where' => array ( ), - 'as' => 'generated::Qc3TrVdDmpobltpq', + 'as' => 'generated::MOt3vLAjE2hdhyas', ), 'fallback' => false, 'defaults' => @@ -3079,14 +3056,14 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'nutzwerte.download' => + 'pdf' => array ( 'methods' => array ( 0 => 'GET', 1 => 'HEAD', ), - 'uri' => 'app/nutzwerte/{record}/{mode}/download', + 'uri' => 'app/pdf/{record}/{type}/{mode}', 'action' => array ( 'middleware' => @@ -3094,14 +3071,14 @@ app('router')->setCompiledRoutes( 0 => 'web', 1 => 'Filament\\Http\\Middleware\\Authenticate', ), - 'uses' => '\\App\\Actions\\Download\\Nutzwerte@download', - 'controller' => '\\App\\Actions\\Download\\Nutzwerte@download', + 'uses' => '\\App\\Actions\\Generate\\Pdf@make', + 'controller' => '\\App\\Actions\\Generate\\Pdf@make', 'namespace' => NULL, 'prefix' => '', 'where' => array ( ), - 'as' => 'nutzwerte.download', + 'as' => 'pdf', ), 'fallback' => false, 'defaults' => @@ -3117,14 +3094,14 @@ app('router')->setCompiledRoutes( 'waitSeconds' => NULL, 'withTrashed' => false, ), - 'standard.download' => + 'excel' => array ( 'methods' => array ( 0 => 'GET', 1 => 'HEAD', ), - 'uri' => 'app/standard/{record}/{mode}/download', + 'uri' => 'app/excel/{record}/{type}', 'action' => array ( 'middleware' => @@ -3132,52 +3109,14 @@ app('router')->setCompiledRoutes( 0 => 'web', 1 => 'Filament\\Http\\Middleware\\Authenticate', ), - 'uses' => '\\App\\Actions\\Download\\Gutachten@download', - 'controller' => '\\App\\Actions\\Download\\Gutachten@download', + 'uses' => '\\App\\Actions\\Generate\\Excel@make', + 'controller' => '\\App\\Actions\\Generate\\Excel@make', 'namespace' => NULL, 'prefix' => '', 'where' => array ( ), - 'as' => 'standard.download', - ), - 'fallback' => false, - 'defaults' => - array ( - ), - 'wheres' => - array ( - ), - 'bindingFields' => - array ( - ), - 'lockSeconds' => NULL, - 'waitSeconds' => NULL, - 'withTrashed' => false, - ), - 'excel.download' => - array ( - 'methods' => - array ( - 0 => 'GET', - 1 => 'HEAD', - ), - 'uri' => 'app/excel/{record}/{mode}/download', - 'action' => - array ( - 'middleware' => - array ( - 0 => 'web', - 1 => 'Filament\\Http\\Middleware\\Authenticate', - ), - 'uses' => '\\App\\Actions\\Download\\Excel@download', - 'controller' => '\\App\\Actions\\Download\\Excel@download', - 'namespace' => NULL, - 'prefix' => '', - 'where' => - array ( - ), - 'as' => 'excel.download', + 'as' => 'excel', ), 'fallback' => false, 'defaults' => @@ -3209,7 +3148,7 @@ app('router')->setCompiledRoutes( $config, $isProduction ))($request, $path); - }";s:5:"scope";s:47:"Illuminate\\Filesystem\\FilesystemServiceProvider";s:4:"this";N;s:4:"self";s:32:"0000000000000f550000000000000000";}}', + }";s:5:"scope";s:47:"Illuminate\\Filesystem\\FilesystemServiceProvider";s:4:"this";N;s:4:"self";s:32:"0000000000000f520000000000000000";}}', 'as' => 'storage.local', ), 'fallback' => false, 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 3a1d26d..ba9dfba 100644 --- a/database/migrations/2025_09_24_131440_create_projektes_table.php +++ b/database/migrations/2025_09_24_131440_create_projektes_table.php @@ -22,12 +22,8 @@ return new class extends Migration $table->text('beschreibung')->nullable(); $table->string('erstellung')->nullable(); $table->string('status')->default('entwurf'); - $table->string('pdf_gutachten_name')->nullable(); $table->string('pdf_nutzwerte_name')->nullable(); - $table->string('excel_nutzwerte_name')->nullable(); $table->boolean('pdf_nutzwerte_status')->default(0); - $table->boolean('pdf_gutachten_status')->default(0); - $table->boolean('excel_nutzwerte_status')->default(0); $table->boolean('evaluation_gutachten')->default(0); $table->timestamp('bezahlt_am')->nullable(); $table->timestamps(); diff --git a/database/migrations/2025_10_02_170241_create_inhaltsverzeichnis_table.php b/database/migrations/2025_10_02_170241_create_inhaltsverzeichnis_table.php index 576091e..592fbd4 100644 --- a/database/migrations/2025_10_02_170241_create_inhaltsverzeichnis_table.php +++ b/database/migrations/2025_10_02_170241_create_inhaltsverzeichnis_table.php @@ -13,14 +13,14 @@ return new class extends Migration { Schema::create('inhaltsverzeichnis', function (Blueprint $table) { $table->id(); + $table->integer('sort')->default(0); + $table->double('ordnungszahl')->default(0); $table->string('name')->nullable(); $table->string('name2')->nullable(); $table->string('part')->nullable(); $table->boolean('ueberschrift_anzeigen')->default(0)->nullable(); $table->integer('tabellen_id')->default(0)->nullable(); $table->integer('textblock_id')->default(0)->nullable(); - $table->integer('sort')->default(0); - $table->double('ordnungszahl')->default(0); $table->integer('seite')->default(0); $table->integer('neue_seite')->default(0); $table->integer('seitenzahl_anzeige')->default(0); diff --git a/database/migrations/2025_10_10_085849_create_projekt_inhaltsverzeichnis_table.php b/database/migrations/2025_10_10_085849_create_projekt_inhaltsverzeichnis_table.php index 194fbb9..d1b1854 100644 --- a/database/migrations/2025_10_10_085849_create_projekt_inhaltsverzeichnis_table.php +++ b/database/migrations/2025_10_10_085849_create_projekt_inhaltsverzeichnis_table.php @@ -14,14 +14,14 @@ return new class extends Migration Schema::create('projekt_inhaltsverzeichnis', function (Blueprint $table) { $table->id(); $table->foreignId('projekte_id')->constrained()->cascadeOnDelete(); + $table->integer('sort')->default(0); + $table->double('ordnungszahl')->default(0); $table->string('name')->nullable(); $table->string('name2')->nullable(); $table->boolean('ueberschrift_anzeigen')->default(0)->nullable(); $table->integer('tabellen_id')->default(0)->nullable(); $table->integer('textblock_id')->default(0)->nullable(); $table->integer('konto_textblock_id')->default(0)->nullable(); - $table->integer('sort')->default(0); - $table->double('ordnungszahl')->default(0); $table->integer('part')->default(0); $table->integer('seite')->default(0); $table->integer('neue_seite')->default(0); diff --git a/database/seeders/InhaltsverzeichnisSeeder.php b/database/seeders/InhaltsverzeichnisSeeder.php index f794f48..de3a2b4 100644 --- a/database/seeders/InhaltsverzeichnisSeeder.php +++ b/database/seeders/InhaltsverzeichnisSeeder.php @@ -15,7 +15,7 @@ class InhaltsverzeichnisSeeder extends Seeder $sql = "INSERT INTO `inhaltsverzeichnis` (`id`, `name`, `name2`, `part`, `ueberschrift_anzeigen`, `tabellen_id`, `textblock_id`, `sort`, `ordnungszahl`, `seite`, `neue_seite`, `seitenzahl_anzeige`, `no_edit`, `created_at`, `updated_at`) VALUES ('1', 'DECKBLATT', NULL, 'standard', '0', '0', '11', '1', '0', '0', '1', '0', '0', NULL, '2025-10-19 08:13:53'), - ('2', 'INHALTSVERZEICHNIS', NULL, 'standard', '0', '1', '0', '3', '0', '0', '1', '0', '0', NULL, '2025-10-19 08:13:53'), + ('2', 'INHALTSVERZEICHNIS', NULL, 'standard', '1', '1', '0', '3', '0', '0', '1', '0', '0', NULL, '2025-10-19 08:13:53'), ('3', 'ALLGEMEINE ANGABEN', NULL, 'standard', '1', '0', '0', '4', '1', '3', '1', '1', '0', NULL, '2025-10-19 08:13:53'), ('4', 'AUFTRAGGEBER', NULL, 'standard', '1', '8', '0', '5', '1.1', '3', '0', '1', '0', NULL, '2025-10-19 08:13:53'), ('5', 'ZWECK UND GEGENSTAND DES GUTACHTENS', NULL, 'standard', '1', '0', '1', '6', '1.2', '3', '0', '1', '0', NULL, '2025-10-19 08:13:53'), diff --git a/database/seeders/TestProjektSeeder.php b/database/seeders/TestProjektSeeder.php index b50bcfa..2009fad 100644 --- a/database/seeders/TestProjektSeeder.php +++ b/database/seeders/TestProjektSeeder.php @@ -12,9 +12,9 @@ class TestProjektSeeder extends Seeder */ public function run(): void { - $sql = "INSERT INTO `projektes` (`id`, `konto_id`, `auftraggeber_id`, `gutachter_id`, `interner_name`, `offizieller_name`, `ort`, `beschreibung`, `erstellung`, `status`, `pdf_gutachten_name`, `pdf_nutzwerte_name`, `excel_nutzwerte_name`, `pdf_nutzwerte_status`, `pdf_gutachten_status`, `excel_nutzwerte_status`, `evaluation_gutachten`, `bezahlt_am`, `created_at`, `updated_at`, `deleted_at`) + $sql = "INSERT INTO `projektes` (`id`, `konto_id`, `auftraggeber_id`, `gutachter_id`, `interner_name`, `offizieller_name`, `ort`, `beschreibung`, `erstellung`, `status`, `pdf_nutzwerte_name`, `pdf_nutzwerte_status`, `evaluation_gutachten`, `bezahlt_am`, `created_at`, `updated_at`, `deleted_at`) VALUES - ('1', '1', '1', '1', 'P310 nht GE03 08 EF PLUS', 'P310 nht Gerlos Haus 2', 'Innsbruck', '

KOPIE! KOPIE! K4: lt. Änderungseinreichung
keine gravierenden unterschiede zu k2+
KOPIE VON EF!!
ÄNDERUNG - TAUSCH TOP 1+2 !!!

ACHTUNG FÜR ENDFASSUNG
gibt Änderung DER GARTENFLÄCHE bei Gartenwohnung W04 wegen neuem Weg über die Böschung zwichen Haus 2 und 3, ist noch nicht eingearbeitet, warten auf OK von nht - sh mail vom 19.09.2025 von studio 23
ansich würde sich an den Nutzwerten nichts verändern! 2NW für Garten G04

GARTENÄNDERUNG AM 24.09.25 ERLEDIGT! EF SEPTEMBER 2025

', '2025-10-22', 'entwurf', NULL, NULL, NULL, '0', '0', '0', '0', NULL, '2025-10-21 04:03:25', '2025-10-21 04:03:25', NULL); + ('1', '1', '1', '1', 'P310 nht GE03 08 EF PLUS', 'P310 nht Gerlos Haus 2', 'Innsbruck', '

KOPIE! KOPIE! K4: lt. Änderungseinreichung
keine gravierenden unterschiede zu k2+
KOPIE VON EF!!
ÄNDERUNG - TAUSCH TOP 1+2 !!!

ACHTUNG FÜR ENDFASSUNG
gibt Änderung DER GARTENFLÄCHE bei Gartenwohnung W04 wegen neuem Weg über die Böschung zwichen Haus 2 und 3, ist noch nicht eingearbeitet, warten auf OK von nht - sh mail vom 19.09.2025 von studio 23
ansich würde sich an den Nutzwerten nichts verändern! 2NW für Garten G04

GARTENÄNDERUNG AM 24.09.25 ERLEDIGT! EF SEPTEMBER 2025

', '2025-10-22', 'entwurf', '', '0', '1', '2025-10-29 11:24:24', '2025-10-21 04:03:25', '2025-10-31 10:43:08', NULL); "; DB::unprepared($sql); diff --git a/resources/css/pdf-download.css b/resources/css/pdf-download.css index 01b2192..c786f56 100644 --- a/resources/css/pdf-download.css +++ b/resources/css/pdf-download.css @@ -169,7 +169,8 @@ table { empty-cells: show; width: 100% !important; font-size: 11px; - margin-top: 20mm; + margin-top: 10mm; + margin-bottom: 10mm; } .table-striped tr:nth-child(2n-1) td { diff --git a/resources/views/download/gutachten.blade.php b/resources/views/download/gutachten.blade.php deleted file mode 100644 index 17fc974..0000000 --- a/resources/views/download/gutachten.blade.php +++ /dev/null @@ -1,80 +0,0 @@ - - - - Invoice - - - - - -
-
-
-
Your Company Name
-
-
-
Invoice
-
Date: 01/05/2023
-
Invoice #: {{ $invoiceNumber }}
-
-
-
-

Bill To:

-
{{ $customerName }}
-
123 Main St.
-
Anytown, USA 12345
-
johndoe@example.com
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DescriptionQuantityPriceTotal
Product 11$100.00$100.00
Product 22$50.00$100.00
Product 33$75.00$225.00
-
-
Subtotal:
-
$425.00
-
-
-
Tax:
-
$25.50
- -
-
-
Total:
-
$450.50
-
-
-
Payment is due within 30 days. Late payments are subject to fees.
-
Please make checks payable to Your Company Name and mail to:
-
123 Main St., Anytown, USA 12345
-
- - - - - diff --git a/routes/web.php b/routes/web.php index bded453..43ca0e5 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,8 +1,7 @@ get('/app/nutzwerte/{record}/{mode}/download', [Nutzwerte::class, 'download'])->name('nutzwerte.download'); -Route::middleware(Authenticate::class)->get('/app/standard/{record}/{mode}/download', [Gutachten::class, 'download'])->name('standard.download'); -Route::middleware(Authenticate::class)->get('/app/excel/{record}/{mode}/download', [Excel::class, 'download'])->name('excel.download'); +Route::middleware(Authenticate::class)->get('/app/pdf/{record}/{type}/{mode}', [Pdf::class, 'make'])->name('pdf'); +Route::middleware(Authenticate::class)->get('/app/excel/{record}/{type}', [Excel::class, 'make'])->name('excel');