wip zusammmenstellung
This commit is contained in:
1 parent
f0e1e801c0
commit
2f6ae7e4a1
9 files changed
+163
-118
No files matched your search
@@ -1,91 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Generate\Nutzwerte;
|
||||
|
||||
use App\Models\Raumorientierung;
|
||||
use App\Utilities\Format;
|
||||
use App\Utilities\Html;
|
||||
|
||||
class Zusammenstellung
|
||||
{
|
||||
public static function load(int $projekts_id)
|
||||
{
|
||||
|
||||
$html = '';
|
||||
|
||||
$res = Raumorientierung::select('nutzwert_summe')->where('projekts_id', $projekts_id);
|
||||
$nutzwert_summe = $res->sum('nutzwert_summe');
|
||||
|
||||
$summe_prozent = [];
|
||||
$summe_nutzwert = [];
|
||||
|
||||
$html .= '<table class="text-75 table-striped">';
|
||||
$html .= '<thead><tr>';
|
||||
$html .= Html::td('Top', 'head bl bt bb');
|
||||
$html .= Html::td('Geschoß', 'head bt bb');
|
||||
$html .= Html::td('Orientierung', 'head bt bb');
|
||||
$html .= Html::td('Type', 'head bt bb');
|
||||
$html .= Html::td('NW', 'head center bt bb');
|
||||
$html .= Html::td('x2 *', 'head center bt bb');
|
||||
$html .= Html::td('%', 'head center bt bb br');
|
||||
$html .= '</tr></thead>';
|
||||
|
||||
$res = Zusammenstellung_Methode1::load($projekts_id);
|
||||
|
||||
foreach ($res as $row) {
|
||||
$str = '';
|
||||
$prozent = '';
|
||||
if ($nutzwert_summe > 0) {
|
||||
|
||||
$str = $row['nutzwert_summe'] * 2 .' / '.$nutzwert_summe * 2 .' tel Anteil =';
|
||||
|
||||
$tmp = ($row['nutzwert_summe'] * 2) / ($nutzwert_summe * 2) * 100;
|
||||
$prozent = Format::numeric($tmp, 3).'%';
|
||||
}
|
||||
$summe_prozent[] = $tmp;
|
||||
$summe_nutzwert[] = $row['nutzwert_summe'];
|
||||
|
||||
$html .= '<tr>';
|
||||
$html .= Html::td($row['top_nr'], 'bl bb br');
|
||||
$html .= Html::td($row['geschoss'], 'bb br');
|
||||
$html .= Html::td($row['orientierung'], 'center bb br');
|
||||
$html .= Html::td($row['type'], 'bb br');
|
||||
$html .= Html::td(round($row['nutzwert_summe']), 'center bb br');
|
||||
$html .= Html::td($str, 'center bb br');
|
||||
$html .= Html::td($prozent, 'center bb br');
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
$_obj = Zusammenstellung_Methode5::load($projekts_id);
|
||||
|
||||
foreach ($_obj as $row) {
|
||||
$row['nutzwert_summe2'] = $row['nutzwert_summe'] * 2 .' / '.$nutzwert_summe * 2 .' tel Anteil =';
|
||||
$tmp = ($row['nutzwert_summe'] * 2) / ($nutzwert_summe * 2) * 100;
|
||||
$row['prozent'] = Format::numeric($tmp, 3).'%';
|
||||
|
||||
$summe_prozent[] = $tmp;
|
||||
$summe_nutzwert[] = $row['nutzwert_summe'];
|
||||
|
||||
$html .= '<tr>';
|
||||
$html .= Html::td($row['top_nr'], 'bl bb br');
|
||||
$html .= Html::td($row['geschoss'], 'bb br');
|
||||
$html .= Html::td($row['orientierung'], 'center bb br');
|
||||
$html .= Html::td($row['type'], 'bb br');
|
||||
$html .= Html::td(round($row['nutzwert_summe']), 'center bb br');
|
||||
$html .= Html::td($row['nutzwert_summe2'], 'center bb br');
|
||||
$html .= Html::td($row['prozent'], 'center bb br');
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
$html .= '<tr>';
|
||||
$html .= Html::td('', 'head bl bb', 4);
|
||||
$html .= Html::td(array_sum($summe_nutzwert), 'head center bb');
|
||||
$html .= Html::td(array_sum($summe_nutzwert) * 2 .'/'.round($nutzwert_summe) * 2 .' tel Anteil =', 'head center bb');
|
||||
$html .= Html::td(round(array_sum($summe_prozent)).'%', 'head center bb br');
|
||||
$html .= '</tr>';
|
||||
$html .= '</table>';
|
||||
$html .= '<p class="text-small">* Die Anteile wurden verdoppelt, sodaß die Mindestanteile jederzeit durch zwei geteilt werden können.';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ use App\Actions\Generate\Pdf\Platzhalter;
|
||||
use App\Actions\Generate\Pdf\Ueberschrift;
|
||||
use App\Actions\Generate\Tabellen\Allgemeinflaechen;
|
||||
use App\Actions\Generate\Tabellen\Paragraph6;
|
||||
use App\Actions\Generate\Tabellen\Zusammenstellung;
|
||||
use App\Actions\Generate\Tabellen\ZuUndAbschlaege;
|
||||
use App\Actions\Generate\Utilities\Format;
|
||||
use App\Models\Auftraggeber;
|
||||
@@ -121,6 +122,9 @@ class Pdf
|
||||
case '5':
|
||||
$html .= ZuUndAbschlaege::load($projekte_id);
|
||||
break;
|
||||
case '7':
|
||||
$html .= Zusammenstellung::load($projekte_id);
|
||||
break;
|
||||
case '8':
|
||||
$str = RichContentRenderer::make(self::$auftraggeber->referenz_formatting)->toHtml();
|
||||
$html .= Format::fix_str($str);
|
||||
|
||||
@@ -17,18 +17,7 @@ class Allgemeinflaechen
|
||||
|
||||
$_data = array_chunk($_allgemeine, 2);
|
||||
|
||||
$html = '<table class="table-striped bl bt">';
|
||||
$html .= '<tr>';
|
||||
$html .= '<thead>';
|
||||
$html .= Html::td('Geschoß', 'head bl bt wp10');
|
||||
$html .= Html::td('Typ', 'head bl bt wp25');
|
||||
$html .= Html::td('Fläche', 'head bl bt br wp10');
|
||||
$html .= '<td style="background:white"></td>';
|
||||
$html .= Html::td('Geschoß', 'head bl bt wp10');
|
||||
$html .= Html::td('Typ', 'head bl bt wp25');
|
||||
$html .= Html::td('Fläche', 'head bl bt br wp10');
|
||||
$html .= '</thead>';
|
||||
$html .= '</tr>';
|
||||
$html = Html::table_2_columns(['Geschoß', 'Typ', 'Fläche']);
|
||||
|
||||
foreach ($_data as $value) { //
|
||||
$html .= '<tr>';
|
||||
|
||||
@@ -38,8 +38,7 @@ class ZuUndAbschlaege
|
||||
$header_row[] = 'Summe Merkmale';
|
||||
$header_row[] = 'Wohnungsbewertung';
|
||||
|
||||
$html = '<table class="table-striped">';
|
||||
$html .= Html::table_header_90($header_row);
|
||||
$html = Html::table_header_90($header_row);
|
||||
|
||||
foreach ($objekte as $objekt) {
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Generate\Tabellen;
|
||||
|
||||
use App\Actions\Generate\Utilities\Format;
|
||||
use App\Actions\Generate\Utilities\Html;
|
||||
use App\Models\ProjektObjekte;
|
||||
use App\Models\ProjektObjekteImDetail;
|
||||
|
||||
class Zusammenstellung
|
||||
{
|
||||
public static function load(int $projekte_id)
|
||||
{
|
||||
|
||||
$summe_prozent = [];
|
||||
$summe_nutzwert = [];
|
||||
|
||||
$html = Html::table_header(['Top', 'Geschoß', 'Orientierung', 'Typ', 'Nutzwert', 'x2 *', '%']);
|
||||
|
||||
$nutzwert_gesammt = ProjektObjekteImDetail::where('projekte_id', $projekte_id)->sum('nutzwert');
|
||||
|
||||
$objekte = ProjektObjekte::select()
|
||||
->with('orientierung')
|
||||
->where('projekte_id', $projekte_id)
|
||||
->orderBy('nicht_in_orientierung', 'ASC')
|
||||
->orderBy('top_nummer', 'ASC')
|
||||
->get();
|
||||
|
||||
foreach ($objekte as $objekt) {
|
||||
|
||||
$objektimdetail = ProjektObjekteImDetail::where('projekt_objekte_id', $objekt->id)->get();
|
||||
|
||||
$nutzwert = $objektimdetail->sum('nutzwert');
|
||||
|
||||
$tmp = '';
|
||||
$str = '';
|
||||
if ($nutzwert > 0) {
|
||||
|
||||
$str = $nutzwert * 2 .' / '.$nutzwert_gesammt * 2 .' tel Anteil =';
|
||||
|
||||
$tmp = ($nutzwert * 2) / ($nutzwert_gesammt * 2) * 100;
|
||||
$prozent = Format::dezimal($tmp, 3).'%';
|
||||
}
|
||||
$summe_prozent[] = $tmp;
|
||||
$summe_nutzwert[] = $nutzwert;
|
||||
|
||||
$html .= '<tr>';
|
||||
$html .= Html::td($objekt->top_nummer, 'bl bb br');
|
||||
$html .= Html::td($objekt->projektobjekteimdetail?->geschoss, 'center br bb');
|
||||
$html .= Html::td($objekt->orientierung?->name, 'center br bb');
|
||||
$html .= Html::td($objekt?->type, 'center br bb');
|
||||
$html .= Html::td(round($nutzwert), 'center bb br');
|
||||
$html .= Html::td($str, 'center bb br');
|
||||
$html .= Html::td($prozent ?? '', 'center bb br');
|
||||
$html .= '</tr>';
|
||||
}
|
||||
$html .= '<tr>';
|
||||
$html .= Html::td('', 'head bl bb', 4);
|
||||
$html .= Html::td(array_sum($summe_nutzwert), 'head center bb');
|
||||
$html .= Html::td(array_sum($summe_nutzwert) * 2 .'/'.round($nutzwert_gesammt) * 2 .' tel Anteil =', 'head center bb');
|
||||
$html .= Html::td(round(array_sum($summe_prozent)).'%', 'head center bb br');
|
||||
$html .= '</tr>';
|
||||
$html .= '<tr style="background-color: #fff !important;">';
|
||||
$html .= Html::td('* Die Anteile wurden verdoppelt, sodaß die Mindestanteile jederzeit durch zwei geteilt werden können.', 'right small', 7, 'background-color: #fff !important;');
|
||||
$html .= '</tr>';
|
||||
|
||||
$html .= '</table>';
|
||||
// $html .= '<p class="small">* Die Anteile wurden verdoppelt, sodaß die Mindestanteile jederzeit durch zwei geteilt werden können.';
|
||||
|
||||
return $html;
|
||||
|
||||
// $_obj = Zusammenstellung_Methode5::load($projekte_id);
|
||||
|
||||
// foreach ($_obj as $row) {
|
||||
// $row['nutzwert_summe2'] = $row['nutzwert_summe'] * 2 .' / '.$nutzwert_summe * 2 .' tel Anteil =';
|
||||
// $tmp = ($row['nutzwert_summe'] * 2) / ($nutzwert_summe * 2) * 100;
|
||||
// $row['prozent'] = Format::numeric($tmp, 3).'%';
|
||||
|
||||
// $summe_prozent[] = $tmp;
|
||||
// $summe_nutzwert[] = $row['nutzwert_summe'];
|
||||
|
||||
// $html .= '<tr>';
|
||||
// $html .= Html::td($row['top_nr'], 'bl bb br');
|
||||
// $html .= Html::td($row['geschoss'], 'bb br');
|
||||
// $html .= Html::td($row['orientierung'], 'center bb br');
|
||||
// $html .= Html::td($row['type'], 'bb br');
|
||||
// $html .= Html::td(round($row['nutzwert_summe']), 'center bb br');
|
||||
// $html .= Html::td($row['nutzwert_summe2'], 'center bb br');
|
||||
// $html .= Html::td($row['prozent'], 'center bb br');
|
||||
// $html .= '</tr>';
|
||||
// }
|
||||
|
||||
// $html .= '<tr>';
|
||||
// $html .= Html::td('', 'head bl bb', 4);
|
||||
// $html .= Html::td(array_sum($summe_nutzwert), 'head center bb');
|
||||
// $html .= Html::td(array_sum($summe_nutzwert) * 2 .'/'.round($nutzwert_summe) * 2 .' tel Anteil =', 'head center bb');
|
||||
// $html .= Html::td(round(array_sum($summe_prozent)).'%', 'head center bb br');
|
||||
// $html .= '</tr>';
|
||||
// $html .= '</table>';
|
||||
// $html .= '<p class="text-small">* Die Anteile wurden verdoppelt, sodaß die Mindestanteile jederzeit durch zwei geteilt werden können.';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
@@ -4,23 +4,53 @@ namespace App\Actions\Generate\Utilities;
|
||||
|
||||
class Html
|
||||
{
|
||||
public static function table_header_90($header_row)
|
||||
public static function table_header($header_row)
|
||||
{
|
||||
$html = '<thead><tr text-rotate="90">';
|
||||
$mm = 190 / \count($header_row);
|
||||
$html = '<table class="table-striped">';
|
||||
$html .= '<thead><tr>';
|
||||
foreach ($header_row as $value) {
|
||||
$html .= '<th class="bl bt br bb center hellblau" style="vertical-align: bottom; width: '.$mm.'mm;">'.$value.'</th>';
|
||||
$html .= '<th class="bl bt br bb center bg-sky py-2">'.$value.'</th>';
|
||||
}
|
||||
$html .= '</tr></thead>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function td($value = '', $classname = '', $colspan = 0)
|
||||
public static function table_header_90($header_row)
|
||||
{
|
||||
$html = '<table class="table-striped">';
|
||||
$html .= '<thead><tr text-rotate="90">';
|
||||
$mm = 190 / \count($header_row);
|
||||
foreach ($header_row as $value) {
|
||||
$html .= '<th class="bl bt br bb center bg-sky" style="vertical-align: bottom; width: '.$mm.'mm;">'.$value.'</th>';
|
||||
}
|
||||
$html .= '</tr></thead>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function table_2_columns($header_row)
|
||||
{
|
||||
|
||||
$html = '<table class="table-striped"><thead><tr>';
|
||||
foreach ($header_row as $value) {
|
||||
$html .= '<th class="bl bt br bb bg-sky py-2">'.$value.'</th>';
|
||||
}
|
||||
$html .= '<th style="background:white"></th>';
|
||||
foreach ($header_row as $value) {
|
||||
$html .= '<th class="bl bt br bb bg-sky py-2">'.$value.'</th>';
|
||||
}
|
||||
$html .= '</thead></tr>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function td($value = '', $classname = '', $colspan = 0, $style = '')
|
||||
{
|
||||
$cls = $classname != '' ? ' class="'.$classname.'"' : '';
|
||||
$spn = $colspan != '' ? ' colspan="'.$colspan.'"' : '';
|
||||
$style = $style != '' ? ' style="'.$style.'"' : '';
|
||||
|
||||
return "<td $cls $spn>".$value.'</td>';
|
||||
return "<td $cls $spn $style>".$value.'</td>';
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ class GutachtenValidation
|
||||
/**
|
||||
* ProjektObjekte & ProjektObjekteImDetail
|
||||
*/
|
||||
$res = ProjektObjekte::with('ProjektObjekteImDetail')->where('projekte_id', $record->id)->get();
|
||||
$res = ProjektObjekte::with('projektobjekteimdetail')->where('projekte_id', $record->id)->get();
|
||||
if (! $res->count()) {
|
||||
Notification::make()
|
||||
->title('Tabelle Objekte im Detail')
|
||||
@@ -146,8 +146,7 @@ class GutachtenValidation
|
||||
|
||||
foreach ($res as $value) {
|
||||
|
||||
$raeume = $value->ProjektObjekteImDetail->toArray();
|
||||
$raeume = $raeume[0] ?? [];
|
||||
$raeume = $value->projektobjekteimdetail->toArray();
|
||||
|
||||
if (! count($raeume)) {
|
||||
Notification::make()
|
||||
|
||||
@@ -34,4 +34,9 @@ class ProjektObjekteImDetail extends Model
|
||||
{
|
||||
return $this->belongsTo(ProjektObjekte::class, 'projekt_objekte_id', 'id');
|
||||
}
|
||||
|
||||
public function merkmale()
|
||||
{
|
||||
return $this->hasOne(ProjektMerkmale::class, 'raumart', 'raumart');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user