ZuUndAbschlaege wip
This commit is contained in:
1 parent
622b37bb90
commit
c7f69d2efe
4 files changed
+27
-28
No files matched your search
@@ -9,6 +9,7 @@ use App\Actions\Generate\Pdf\Platzhalter;
|
|||||||
use App\Actions\Generate\Pdf\Ueberschrift;
|
use App\Actions\Generate\Pdf\Ueberschrift;
|
||||||
use App\Actions\Generate\Tabellen\Allgemeinflaechen;
|
use App\Actions\Generate\Tabellen\Allgemeinflaechen;
|
||||||
use App\Actions\Generate\Tabellen\Paragraph6;
|
use App\Actions\Generate\Tabellen\Paragraph6;
|
||||||
|
use App\Actions\Generate\Tabellen\ZuUndAbschlaege;
|
||||||
use App\Actions\Generate\Utilities\Format;
|
use App\Actions\Generate\Utilities\Format;
|
||||||
use App\Models\Auftraggeber;
|
use App\Models\Auftraggeber;
|
||||||
use App\Models\Gutachter;
|
use App\Models\Gutachter;
|
||||||
@@ -49,13 +50,13 @@ class Pdf
|
|||||||
$filepath = Storage::disk('public')->path("/download/$projekte_id/");
|
$filepath = Storage::disk('public')->path("/download/$projekte_id/");
|
||||||
$filename = \ucfirst($type).' '.preg_replace("'[^0-9a-zA-Z]'", '', self::$projekt->interner_name).'.pdf';
|
$filename = \ucfirst($type).' '.preg_replace("'[^0-9a-zA-Z]'", '', self::$projekt->interner_name).'.pdf';
|
||||||
|
|
||||||
if ($type == 'nutzwerte') {
|
// if ($type == 'nutzwerte') {
|
||||||
if ($mode == 'new') {
|
// if ($mode == 'new') {
|
||||||
Projekte::where('id', $projekte_id)->update(['pdf_gutachten_name' => '', 'pdf_nutzwerte_status' => 1]);
|
// Projekte::where('id', $projekte_id)->update(['pdf_nutzwerte_name' => '', 'pdf_nutzwerte_status' => 1]);
|
||||||
} else {
|
// } else {
|
||||||
return Response::download($file, $filename, $headers);
|
// return Response::download($file, $filename, $headers);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (! File::isDirectory($filepath)) {
|
if (! File::isDirectory($filepath)) {
|
||||||
File::makeDirectory($filepath, 0777, true, true);
|
File::makeDirectory($filepath, 0777, true, true);
|
||||||
@@ -117,6 +118,9 @@ class Pdf
|
|||||||
case '4':
|
case '4':
|
||||||
$html .= Allgemeinflaechen::load($projekte_id);
|
$html .= Allgemeinflaechen::load($projekte_id);
|
||||||
break;
|
break;
|
||||||
|
case '5':
|
||||||
|
$html .= ZuUndAbschlaege::load($projekte_id);
|
||||||
|
break;
|
||||||
case '8':
|
case '8':
|
||||||
$str = RichContentRenderer::make(self::$auftraggeber->referenz_formatting)->toHtml();
|
$str = RichContentRenderer::make(self::$auftraggeber->referenz_formatting)->toHtml();
|
||||||
$html .= Format::fix_str($str);
|
$html .= Format::fix_str($str);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use App\Actions\Generate\Utilities\Html;
|
|||||||
use App\Models\ProjektMerkmale;
|
use App\Models\ProjektMerkmale;
|
||||||
use App\Models\ProjektMethode;
|
use App\Models\ProjektMethode;
|
||||||
use App\Models\ProjektObjekte;
|
use App\Models\ProjektObjekte;
|
||||||
|
use App\Models\ProjektObjekteImDetail;
|
||||||
|
|
||||||
class ZuUndAbschlaege
|
class ZuUndAbschlaege
|
||||||
{
|
{
|
||||||
@@ -15,11 +16,9 @@ class ZuUndAbschlaege
|
|||||||
|
|
||||||
$objekte = ProjektObjekte::select()
|
$objekte = ProjektObjekte::select()
|
||||||
->with('orientierung')
|
->with('orientierung')
|
||||||
->with('projektobjekteimdetail')
|
|
||||||
->where('projekte_id', $projekte_id)
|
->where('projekte_id', $projekte_id)
|
||||||
->where('nicht_in_orientierung', 0)
|
->where('nicht_in_orientierung', 0)
|
||||||
->get()
|
->get();
|
||||||
->toArray();
|
|
||||||
|
|
||||||
$has_loggien = ProjektMethode::where('projekte_id', $projekte_id)->where('methode_id', 2)->count();
|
$has_loggien = ProjektMethode::where('projekte_id', $projekte_id)->where('methode_id', 2)->count();
|
||||||
|
|
||||||
@@ -36,7 +35,7 @@ class ZuUndAbschlaege
|
|||||||
$markmale_codes[] = $key;
|
$markmale_codes[] = $key;
|
||||||
$header_row[] = $value;
|
$header_row[] = $value;
|
||||||
}
|
}
|
||||||
$header_row[] = 'Summe ProjektMerkmale';
|
$header_row[] = 'Summe Merkmale';
|
||||||
$header_row[] = 'Wohnungsbewertung';
|
$header_row[] = 'Wohnungsbewertung';
|
||||||
|
|
||||||
$html = '<table class="table-striped">';
|
$html = '<table class="table-striped">';
|
||||||
@@ -44,15 +43,9 @@ class ZuUndAbschlaege
|
|||||||
|
|
||||||
foreach ($objekte as $objekt) {
|
foreach ($objekte as $objekt) {
|
||||||
|
|
||||||
// dd($objekt);
|
$detail = ProjektObjekteImDetail::where('projekt_objekte_id', $objekt->id)->get();
|
||||||
|
$flaeche = $detail->sum('flaeche');
|
||||||
$flaeche = 0;
|
$geschoss = $detail->first()->geschoss;
|
||||||
foreach ($objekt['projektobjekteimdetail'] as $key => $value) {
|
|
||||||
$geschoss = $value['geschoss'];
|
|
||||||
$flaeche += $value['flaeche'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// dd($markmale_codes);
|
|
||||||
|
|
||||||
$html .= '<tr>';
|
$html .= '<tr>';
|
||||||
$html .= Html::td($objekt['top_nummer'], 'left bl br bb');
|
$html .= Html::td($objekt['top_nummer'], 'left bl br bb');
|
||||||
@@ -68,11 +61,13 @@ class ZuUndAbschlaege
|
|||||||
// // Gesammtnutzfläche = Nutzfläache + Loggia
|
// // Gesammtnutzfläche = Nutzfläache + Loggia
|
||||||
// $html .= Html::td(Format::numeric($gesnutzfl, 2), 'right br bb');
|
// $html .= Html::td(Format::numeric($gesnutzfl, 2), 'right br bb');
|
||||||
// dd($objekt);
|
// dd($objekt);
|
||||||
|
$nutwert = 0;
|
||||||
foreach ($markmale_codes as $code) {
|
foreach ($markmale_codes as $code) {
|
||||||
$html .= Html::td($objekt[$code], 'center br bb');
|
$nutwert += $objekt[$code];
|
||||||
|
$html .= Html::td(Format::dezimal($objekt[$code], 2), 'center br bb');
|
||||||
}
|
}
|
||||||
$html .= Html::td(Format::dezimal($objekt['nutzwert'], 2), 'center br bb');
|
$html .= Html::td(Format::dezimal($nutwert, 2), 'center br bb');
|
||||||
$html .= Html::td(Format::dezimal(100 + $objekt['nutzwert'], 2), 'right br bb');
|
$html .= Html::td(Format::dezimal(100 + $nutwert, 2), 'right br bb');
|
||||||
$html .= '</tr>';
|
$html .= '</tr>';
|
||||||
}
|
}
|
||||||
$html .= '</table>';
|
$html .= '</table>';
|
||||||
|
|||||||
@@ -15,16 +15,16 @@ class Format
|
|||||||
|
|
||||||
public static function index($value)
|
public static function index($value)
|
||||||
{
|
{
|
||||||
if (is_numeric($value) && $value * 1 > 0) {
|
if (is_numeric($value) && $value * 1 != 0) {
|
||||||
return number_format($value, 2, '.', '.');
|
return number_format($value, 2, '.', '.');
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function dezimal($value, $stellen = 2)
|
public static function dezimal($value, $stellen)
|
||||||
{
|
{
|
||||||
if (is_numeric($value) && $value * 1 > 0) {
|
if (is_numeric($value) && $value != 0) {
|
||||||
return number_format($value, $stellen, ',', '.');
|
return number_format($value, $stellen, ',', '.');
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ class Projekte extends Model
|
|||||||
'beschreibung',
|
'beschreibung',
|
||||||
'erstellung',
|
'erstellung',
|
||||||
'status',
|
'status',
|
||||||
'pdf_gutachten_name',
|
|
||||||
'pdf_nutzwerte_name',
|
'pdf_nutzwerte_name',
|
||||||
'excel_nutzwerte_name',
|
'pdf_nutzwerte_status',
|
||||||
|
'evaluation_gutachten',
|
||||||
'bezahlt_am',
|
'bezahlt_am',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user