diff --git a/app/Actions/Generate/PdfGenerator.php b/app/Actions/Generate/PdfGenerator.php index 430b072..d76b33f 100644 --- a/app/Actions/Generate/PdfGenerator.php +++ b/app/Actions/Generate/PdfGenerator.php @@ -113,6 +113,7 @@ class PdfGenerator $html = ''; $html = Ueberschrift::load($inhalt); + $textblock = ''; if ($inhalt->textblock) { $textblock = Platzhalter::replace($platzhalter, $inhalt->textblock); diff --git a/app/Actions/Generate/Tabellen/ZuUndAbschlaege.php b/app/Actions/Generate/Tabellen/ZuUndAbschlaege.php index 2dbee2d..d9dccef 100644 --- a/app/Actions/Generate/Tabellen/ZuUndAbschlaege.php +++ b/app/Actions/Generate/Tabellen/ZuUndAbschlaege.php @@ -39,6 +39,9 @@ class ZuUndAbschlaege $html = Html::table_header_90($header_row); + $summe_nutzfl = 0; + $summe_loggia = 0; + foreach ($objekte as $objekt) { $detail = DB::table('projekt_objekte_im_details') @@ -60,11 +63,15 @@ class ZuUndAbschlaege $geschoss = $detail->first()->geschoss; $html .= ''; - $html .= Html::td($objekt['top_nummer'], 'center bl br bb'); + $html .= Html::td($objekt->top_nummer, 'center bl br bb'); $html .= Html::td($geschoss, 'center br bb'); - $html .= Html::td($objekt['type'], 'br bb'); + $html .= Html::td($objekt->type, 'br bb'); // Nutzfläche $html .= Html::td(Format::dezimal($flaeche, 2).' m²', 'center br bb w30'); + + // SUMME Nutzfläche + $summe_nutzfl += $flaeche; + // Loggia if ($has_loggien) { @@ -82,19 +89,41 @@ class ZuUndAbschlaege } else { $html .= Html::td('', 'br bb'); } + + // SUMME Loggien + $summe_loggia += $flaeche_loggien; + $gesammt = $flaeche + $flaeche_loggien; $html .= Html::td(Format::dezimal($gesammt, 2).' m²', 'center br bb'); } $nutwert = 0; foreach ($markmale_codes as $code) { - $nutwert += $objekt[$code]; - $html .= Html::td(Format::dezimal($objekt[$code], 2), 'center br bb'); + $nutwert += $objekt->$code; + $html .= Html::td(Format::dezimal($objekt->$code, 2), 'center br bb'); } $html .= Html::td(Format::dezimal($nutwert, 2), 'center br bb'); $html .= Html::td(Format::dezimal(100 + $nutwert, 2), 'right br bb'); $html .= ''; } + + // SUMMEN + $html .= ''; + $html .= Html::td('Summen', 'center bold bl bb'); + $html .= Html::td('', 'bb'); + $html .= Html::td('', 'bb'); + $html .= Html::td(Format::dezimal($summe_nutzfl, 2).' m²', 'bold center bb'); + if ($summe_loggia) { + $html .= Html::td(Format::dezimal($summe_loggia, 2).' m²', 'bold center bb'); + } + $html .= Html::td(Format::dezimal($summe_nutzfl + $summe_loggia, 2).' m²', 'bold center bb nowrap'); + $html .= Html::td('', 'bb'); + $html .= Html::td('', 'bb'); + $html .= Html::td('', 'bb'); + $html .= Html::td('', 'bb'); + $html .= Html::td('', 'bb br'); + $html .= ''; + $html .= ''; return $html;