wip zuabschlaege pdf
This commit is contained in:
1 parent
88d561675d
commit
7917777b93
23 files changed
+510
-604
No files matched your search
@@ -10,8 +10,7 @@ class Inhalt
|
||||
{
|
||||
public static function create($projekte_id)
|
||||
{
|
||||
$html = '<div class="header">INHALTSVERZEICHNIS</div>';
|
||||
$html .= '<table class="inhalt">';
|
||||
$html = '<table class="inhalt">';
|
||||
$inhalte = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->orderBy('sort')->get();
|
||||
foreach ($inhalte as $inhalt) {
|
||||
if ($inhalt->ueberschrift_anzeigen) {
|
||||
|
||||
@@ -16,5 +16,6 @@ class Ueberschrift
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -71,13 +71,13 @@ class MakeGutachten
|
||||
$textblock = Format::fix_str($textblock);
|
||||
}
|
||||
|
||||
if ($inhalt->name == 'DECKBLATT') {
|
||||
$html = Deckblatt::create($textblock);
|
||||
} elseif ($inhalt->name == 'INHALTSVERZEICHNIS') {
|
||||
$html = Inhalt::create($projekte_id);
|
||||
} else {
|
||||
$html = Ueberschrift::create($inhalt);
|
||||
|
||||
$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;
|
||||
|
||||
@@ -70,25 +70,25 @@ class MakeNutzwerte
|
||||
$mpdf->AddPage();
|
||||
}
|
||||
|
||||
$html = Ueberschrift::create($inhalt);
|
||||
|
||||
if ($inhalt->textblock) {
|
||||
$html .= Platzhalter::replace($platzhalter, $inhalt->textblock);
|
||||
$textblock = Platzhalter::replace($platzhalter, $inhalt->textblock);
|
||||
$textblock = Format::fix_str($textblock);
|
||||
}
|
||||
|
||||
$html = Ueberschrift::create($inhalt);
|
||||
|
||||
switch ($inhalt->tabellen_id) {
|
||||
case '5':
|
||||
$html .= ZuUndAbschlaege::load($projekte_id);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($inhalt->seitenzahl_anzeige == 1) {
|
||||
$mpdf->SetHTMLFooter('<div class="center">Seite {PAGENO}<br><br></div>');
|
||||
}
|
||||
if ($html) {
|
||||
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
|
||||
if ($inhalt->seitenzahl_anzeige) {
|
||||
$mpdf->SetHTMLFooter('<div class="center">Seite {PAGENO}<br><br></div>');
|
||||
}
|
||||
if ($html != '') {
|
||||
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
|
||||
}
|
||||
}
|
||||
|
||||
// foreach ($inhalte as $inhalt) {
|
||||
|
||||
@@ -2,72 +2,70 @@
|
||||
|
||||
namespace App\Actions\Generate\Nutzwerte;
|
||||
|
||||
use App\Actions\Generate\Utilities\Format;
|
||||
use App\Actions\Generate\Utilities\Html;
|
||||
use App\Models\Merkmale;
|
||||
use App\Models\ProjektObjekte;
|
||||
use App\Models\Raumalles;
|
||||
use App\Models\Raumorientierung;
|
||||
use App\Utilities\Format;
|
||||
use App\Utilities\Html;
|
||||
|
||||
class ZuUndAbschlaege
|
||||
{
|
||||
public static function load(int $projekte_id)
|
||||
{
|
||||
|
||||
$orientierungen = ProjektObjekte::select()
|
||||
$objekte = ProjektObjekte::select()
|
||||
->with('orientierung')
|
||||
->with('projektobjekteimdetail')
|
||||
->where('projekte_id', $projekte_id)
|
||||
->where('nicht_in_orientierung', 0)
|
||||
->get();
|
||||
|
||||
foreach ($orientierungen as $orientierung) {
|
||||
dd($orientierung);
|
||||
}
|
||||
$header_row = ['Top Nummer', 'Geschoß', 'Typ', 'Nutzfläche', 'Loggia / sonst. Zusatzflächen', 'Gesamtnutzfläche'];
|
||||
|
||||
// $total = Invoice::where('status', 'Completed')->sum('amount');
|
||||
$merkmale = Merkmale::where('projekte_id', $projekte_id)->pluck('name', 'code');
|
||||
|
||||
$header_row = ['Top', 'Geschoß', 'Typ', 'Nutzfläche', 'Loggia / sonst. Zusatzflächen', 'Gesamtnutzfläche'];
|
||||
$merkmale = Merkmale::merkmale($projekte_id);
|
||||
$markmale_col = [];
|
||||
foreach ($merkmale as $value) {
|
||||
$markmale_col[] = $value['col'];
|
||||
$header_row[] = $value['name'];
|
||||
$markmale_codes = [];
|
||||
foreach ($merkmale as $key => $value) {
|
||||
$markmale_codes[] = $key;
|
||||
$header_row[] = $value;
|
||||
}
|
||||
$header_row[] = 'Summe Merkmale';
|
||||
$header_row[] = 'Wohnungsbewertung';
|
||||
$html = Html::table_header_90($header_row);
|
||||
|
||||
$res = Raumalles::select('raumorientierung_id', 'geschoss')->where('projekte_id', $projekte_id)->where('methodes_id', 1)->get();
|
||||
$geschoss = [];
|
||||
foreach ($res as $value) {
|
||||
$id = $value->raumorientierung_id;
|
||||
$geschoss[$id] = $value['geschoss'];
|
||||
}
|
||||
$html = '<table class="table-striped">';
|
||||
$html .= Html::table_header_90($header_row);
|
||||
|
||||
$res = Raumorientierung::select()->where('projekte_id', $projekte_id)->where('nicht_in_orientierung', 0)->whereNotNull('top_nr')->orderBy('top_nr')->get();
|
||||
foreach ($res as $value) {
|
||||
$id = $value->id;
|
||||
$html .= '<tr>';
|
||||
$html .= Html::td($value->top_nr, 'left bl br bb');
|
||||
$html .= Html::td($geschoss[$value['id']], 'center br bb');
|
||||
$html .= Html::td($value->type, 'wp20 br bb');
|
||||
// Nutzfläache
|
||||
$html .= Html::td(Format::numeric($value->qm_m1, 2), 'right br bb');
|
||||
// Loggia
|
||||
$loggia = Raumalles::loggia($id);
|
||||
$gesnutzfl = $loggia + $value->qm_m1;
|
||||
$loggia = $loggia != 0 ? $loggia : '';
|
||||
$html .= Html::td($loggia, 'right br bb');
|
||||
// Gesammtnutzfläche = Nutzfläache + Loggia
|
||||
$html .= Html::td(Format::numeric($gesnutzfl, 2), 'right br bb');
|
||||
foreach ($markmale_col as $col) {
|
||||
$tmp = (float) $value[$col] != 0 ? $value[$col] : '';
|
||||
$html .= Html::td(Format::numeric($tmp, 2), 'right br bb');
|
||||
foreach ($objekte as $objekt) {
|
||||
|
||||
// dd($objekt);
|
||||
|
||||
$flaeche = 0;
|
||||
foreach ($objekt->projektobjekteimdetail as $key => $value) {
|
||||
$geschoss = $value['geschoss'];
|
||||
$flaeche += $value['flaeche'];
|
||||
}
|
||||
$html .= Html::td(Format::numeric($value->summe_az, 2), 'right br bb');
|
||||
$html .= Html::td(Format::numeric($value->bewertung, 2), 'right br bb');
|
||||
|
||||
$html .= '<tr>';
|
||||
$html .= Html::td($objekt->top_nummer, 'left bl br bb');
|
||||
$html .= Html::td($geschoss, 'center br bb');
|
||||
$html .= Html::td($objekt->type, 'wp20 br bb');
|
||||
// Nutzfläache
|
||||
$html .= Html::td(Format::dezimal($flaeche, 2), 'right br bb');
|
||||
// Loggia
|
||||
// $loggia = Raumalles::loggia($id);
|
||||
// $gesnutzfl = $loggia + $objekt->qm_m1;
|
||||
// $loggia = $loggia != 0 ? $loggia : '';
|
||||
// $html .= Html::td($loggia, 'right br bb');
|
||||
// // Gesammtnutzfläche = Nutzfläache + Loggia
|
||||
// $html .= Html::td(Format::numeric($gesnutzfl, 2), 'right br bb');
|
||||
// foreach ($markmale_codes as $code) {
|
||||
// $tmp = (float) $objekt[$code] != 0 ? $objekt[$code] : '';
|
||||
// $html .= Html::td(Format::numeric($tmp, 2), 'right br bb');
|
||||
// }
|
||||
// $html .= Html::td(Format::numeric($objekt->summe_az, 2), 'right br bb');
|
||||
// $html .= Html::td(Format::numeric($objekt->bewertung, 2), 'right br bb');
|
||||
$html .= '</tr>';
|
||||
}
|
||||
$html .= '</table>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
@@ -6,32 +6,16 @@ class Html
|
||||
{
|
||||
public static function table_header_90($_row)
|
||||
{
|
||||
$html = '<thead><tr text-rotate="90deg">';
|
||||
$html = '<thead><tr>';
|
||||
$mm = 190 / \count($_row);
|
||||
foreach ($_row as $value) {
|
||||
$html .= '<td class="head right bl bt br bb" style="background-color:#d1d1d1; width: '.$mm.'mm;">'.$value.'</td>';
|
||||
$html .= '<td class="rotated right bl bt br bb" style="background-color:#eff6ff; width: '.$mm.'mm;">'.$value.'</td>';
|
||||
}
|
||||
$html .= '</tr></thead>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function make_table($str)
|
||||
{
|
||||
$array = explode('<br />', $str);
|
||||
$html = '<table class="table-striped bt bl">';
|
||||
foreach ($array as $value) {
|
||||
$tmp = explode('|', $value);
|
||||
$html .= '<tr>';
|
||||
$html .= self::td($tmp[0], 'br bb');
|
||||
$html .= self::td($tmp[1], 'br bb');
|
||||
$html .= '</tr>';
|
||||
}
|
||||
$html .= '</table>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function td($value = '', $classname = '', $colspan = 0)
|
||||
{
|
||||
$cls = $classname != '' ? ' class="'.$classname.'"' : '';
|
||||
|
||||
Reference in new issue
Block a user