Chore: Verschiebe Git-Repository in das Hauptverzeichnis und richte .gitignore ein
This commit is contained in:
commit
96d0545193
502 files changed
+176027
No files matched your search
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\Berechnungen;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use HermannTelser\Gutachten\Utility\Message;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class Berechnung
|
||||
{
|
||||
/**
|
||||
* @return false
|
||||
*/
|
||||
public static function berechnen()
|
||||
{
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
if (0 == DbFunction::$projektid) {
|
||||
DbFunction::$projektid = GeneralUtility::_GP('id');
|
||||
if (!is_numeric(DbFunction::$projektid)) {
|
||||
DbFunction::$projektid = GeneralUtility::_GP('projekt_aktive');
|
||||
}
|
||||
if (!is_numeric(DbFunction::$projektid)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// ZU NUTZWERT wenn raumart 2,8 => normale Nutzfläche, Methode 2b
|
||||
FaktorenBasis::berechnen();
|
||||
|
||||
FaktorenGenerell::berechnen();
|
||||
|
||||
// Main
|
||||
$_result = DbFunction::select('tx_gutachten_raume_basis', ['id', 'factor', 'noDispInOrientierung'], ['pid' => DbFunction::$projektid]);
|
||||
|
||||
foreach ($_result as $key => $value) {
|
||||
if (1 == $value['noDispInOrientierung']) {
|
||||
OhneOrientierung::berechne($value['id']);
|
||||
} else {
|
||||
MitOrientierung::berechne($value['id'], $value['factor']);
|
||||
}
|
||||
}
|
||||
|
||||
if (DbFunction::$debug) {
|
||||
Message::note('Nutzwerberechnung Ende');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\Berechnungen;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
class FaktorenBasis
|
||||
{
|
||||
/**
|
||||
* @return false
|
||||
*/
|
||||
public static function berechnen()
|
||||
{
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
// ZU NUTZWERT wenn raumart 2,8 => normale Nutzfläche, Methode 2b
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_generell', ['zunutzwert' => 0], ['AND' => ['pid' => DbFunction::$projektid, 'tt_raumart_id[!]' => [2, 8]]]);
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_generell', ['zunutzwert' => 1], ['AND' => ['pid' => DbFunction::$projektid, 'tt_raumart_id' => [2, 8]]]);
|
||||
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_basis', ['noDispInOrientierung' => 0], ['pid' => DbFunction::$projektid]);
|
||||
$res = DbFunction::select('tx_gutachten_raume_all', 'tt_raume_basis_id', ['AND' => ['pid' => DbFunction::$projektid, 'tt_raumart_id' => [5, 6, 9]], 'GROUP' => 'tt_raume_basis_id']);
|
||||
if ($res) {
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_basis', ['noDispInOrientierung' => 1], ['id' => $res]);
|
||||
}
|
||||
|
||||
$fields = range('a', 'u');
|
||||
$res = DbFunction::select('tx_gutachten_raume_basis', 'id', ['AND' => ['pid' => DbFunction::$projektid, 'noDispInOrientierung' => 0]]);
|
||||
foreach ($res as $key => $raume_basis_id) {
|
||||
$arr = DbFunction::select('tx_gutachten_raume_basis', $fields, ['id' => $raume_basis_id]);
|
||||
$summe = array_sum($arr[0]);
|
||||
$bewertung = 100 + $summe;
|
||||
$factor = $bewertung / 100;
|
||||
|
||||
$update_array = [];
|
||||
$update_array['summe_az'] = $summe;
|
||||
$update_array['bewertung'] = $bewertung;
|
||||
$update_array['factor'] = $factor;
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_basis', $update_array, ['id' => $raume_basis_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\Berechnungen;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use HermannTelser\Gutachten\Utility\Message;
|
||||
|
||||
class FaktorenGenerell
|
||||
{
|
||||
/**
|
||||
* @return false
|
||||
*/
|
||||
public static function berechnen()
|
||||
{
|
||||
// DbFunction::$debug = 1;
|
||||
// controll
|
||||
$_raume = DbFunction::select('tx_gutachten_raume_generell', 'raum', ['AND' => ['pid' => DbFunction::$projektid, 'tt_raumart_id[>]' => 1, 'factor' => 0]]);
|
||||
if (\count($_raume) > 0) {
|
||||
$message = "\nProjekt: ".DbFunction::$projektid;
|
||||
$message .= "\nFür folgende Methoden fehlen die Faktoren.\nRäume: ";
|
||||
$message .= implode(', ', $_raume);
|
||||
// Message::error(__FILE__, __LINE__, $message);
|
||||
}
|
||||
|
||||
$_raume = DbFunction::select('tx_gutachten_raume_generell', ['raum', 'factor', 'tt_raumart_id'], ['pid' => DbFunction::$projektid]);
|
||||
foreach ($_raume as $value) {
|
||||
$update_array = [];
|
||||
$update_array['tt_raumart_id'] = $value['tt_raumart_id'];
|
||||
$update_array['factor'] = $value['factor'];
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_all', $update_array, [
|
||||
'AND' => [
|
||||
'raum' => $value['raum'],
|
||||
'pid' => DbFunction::$projektid
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\Berechnungen;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use HermannTelser\Gutachten\Utility\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
***/
|
||||
|
||||
class MitOrientierung
|
||||
{
|
||||
/**
|
||||
* @param mixed $tt_raume_basis_id
|
||||
* @param mixed $rfM1
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
public static function berechne($tt_raume_basis_id, $rfM1)
|
||||
{
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
// METHODEN 1, 2, 2b , 3, 3b, 4
|
||||
|
||||
if (DbFunction::$debug) {
|
||||
Message::note('MIT Orientierung');
|
||||
}
|
||||
|
||||
// METHODE 2 & 2b
|
||||
// Summe
|
||||
$qmM1bis = DbFunction::sum('tx_gutachten_raume_all', 'qm', ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => [2, 8]]]);
|
||||
|
||||
//# METHODE 1 ###
|
||||
$qmM1 = DbFunction::sum('tx_gutachten_raume_all', 'qm', ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 1]]);
|
||||
$result = $qmM1 + $qmM1bis;
|
||||
if ($result) {
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_basis', ['qmM1uM2bis' => $result, 'qmM1' => $qmM1], ['id' => $tt_raume_basis_id]);
|
||||
}
|
||||
|
||||
// METHODE 2
|
||||
$res = DbFunction::select('tx_gutachten_raume_all', ['qm', 'factor'], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => [2, 8]]]);
|
||||
foreach ($res as $key => $value) {
|
||||
$nw = round($value['qm'] * $value['factor']);
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_all', ['NWm2' => $nw], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => [2, 8]]]);
|
||||
}
|
||||
|
||||
// FINAL METHODE 1 & METHODE 2
|
||||
$NWm2 = DbFunction::sum('tx_gutachten_raume_all', 'NWm2', ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 2]]);
|
||||
$NWm2b = DbFunction::sum('tx_gutachten_raume_all', 'NWm2', ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 8]]);
|
||||
$qmM1uM2 = $qmM1 + $NWm2;
|
||||
$NWM1uM2 = round(($qmM1uM2 * $rfM1) + $NWm2b);
|
||||
if ($NWM1uM2) {
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_basis', ['NWM1uM2' => $NWM1uM2, 'qmM1uM2' => $qmM1uM2], ['id' => $tt_raume_basis_id]);
|
||||
}
|
||||
|
||||
// METHODE 3 & 3b
|
||||
$res = DbFunction::select('tx_gutachten_raume_all', ['qm', 'factor', 'tt_raumart_id'], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => [3, 7]]]);
|
||||
foreach ($res as $key => $value) {
|
||||
if (3 == $value['tt_raumart_id']) {
|
||||
$nw = round($value['qm'] * $value['factor'] * $rfM1);
|
||||
$this_tt_raumart_id = 3;
|
||||
} else { // M3b ohne Wohnungsfactor
|
||||
$nw = round($value['qm'] * $value['factor']);
|
||||
$this_tt_raumart_id = 7;
|
||||
}
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_all', ['NW' => $nw], ['AND' => ['id' => $tt_raume_basis_id, 'tt_raumart_id' => $this_tt_raumart_id]]);
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_all', ['NW' => 1], ['AND' => ['NW' => 1, 'id' => $tt_raume_basis_id, 'tt_raumart_id' => $this_tt_raumart_id]]);
|
||||
}
|
||||
|
||||
// METHODE 4
|
||||
$res = DbFunction::select('tx_gutachten_raume_all', ['qm', 'factor'], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 4]]);
|
||||
foreach ($res as $key => $value) {
|
||||
$nw = round($value['qm'] * $value['factor']);
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_all', ['NW' => $nw], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 4]]);
|
||||
}
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_all', ['NW' => 1], ['AND' => ['NW' => 0, 'tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 4]]);
|
||||
|
||||
//## GNO ###
|
||||
$NWM3uM4 = DbFunction::sum('tx_gutachten_raume_all', 'nw', ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => [3, 4]]]);
|
||||
$GNO = round($NWM1uM2 + $NWM3uM4);
|
||||
if ($GNO) {
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_basis', ['GNO' => $GNO], ['id' => $tt_raume_basis_id]);
|
||||
}
|
||||
|
||||
if (DbFunction::$debug) {
|
||||
Message::note('GNO: ' . $GNO);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\Berechnungen;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use HermannTelser\Gutachten\Utility\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
***/
|
||||
|
||||
class OhneOrientierung
|
||||
{
|
||||
/**
|
||||
* @param mixed $tt_raume_basis_id
|
||||
* @param mixed $factor
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
public static function berechne($tt_raume_basis_id)
|
||||
{
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
// METHODEN 5 (5), 5a (6), 5b (9)
|
||||
|
||||
if (DbFunction::$debug) {
|
||||
Message::note('OHNE Orientierung');
|
||||
}
|
||||
|
||||
if (0 == DbFunction::$projektid) {
|
||||
die('No Projekt Id');
|
||||
}
|
||||
|
||||
// METHODE 5
|
||||
$res = DbFunction::select('tx_gutachten_raume_all', ['id', 'qm', 'factor', 'tt_raumart_id'], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 5]]);
|
||||
foreach ($res as $key => $value) {
|
||||
$nw = round($value['qm'] * $value['factor']);
|
||||
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_all', ['NW' => $nw], ['id' => $value['id']]);
|
||||
}
|
||||
|
||||
|
||||
// METHODE 5a
|
||||
$res = DbFunction::select('tx_gutachten_raume_all', ['qm', 'factor', 'tt_raumart_id'], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 6]]);
|
||||
foreach ($res as $key => $value) {
|
||||
$nw = round($value['qm'] * $value['factor']);
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_all', ['NW' => $nw], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 6]]);
|
||||
}
|
||||
|
||||
// METHODE 5b
|
||||
$res = DbFunction::select('tx_gutachten_raume_all', ['qm', 'factor', 'tt_raumart_id'], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 9]]);
|
||||
foreach ($res as $key => $value) {
|
||||
$nw = $value['qm'] * $value['factor'];
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_all', ['NWungerundet' => $nw], ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 9]]);
|
||||
}
|
||||
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_basis', ['NW' => 1], ['AND' => ['NW' => 0, 'id' => $tt_raume_basis_id, 'tt_raumart_id' => [5, 6, 9]]]);
|
||||
//
|
||||
$t1 = DbFunction::sum('tx_gutachten_raume_all', 'NW', ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => [5, 6]]]);
|
||||
$t2 = DbFunction::sum('tx_gutachten_raume_all', 'NWungerundet', ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => 9]]);
|
||||
$NWM5 = round($t1 + $t2);
|
||||
DbFunction::secureUpdate('tx_gutachten_raume_basis', ['GNO' => $NWM5], ['id' => $tt_raume_basis_id]);
|
||||
|
||||
// $qmM5 = DbFunction::sum('tx_gutachten_raume_all', 'qm', ['AND' => ['tt_raume_basis_id' => $tt_raume_basis_id, 'tt_raumart_id' => [5, 6, 9]]]);
|
||||
// DbFunction::secureUpdate('tx_gutachten_raume_basis', ['qmM5' => $qmM5], ['tt_raume_basis_id' => $tt_raume_basis_id]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user