From f7d315d4ccfcc7aefa403c7ee99a9cf9912dba06 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Sat, 21 Jan 2023 13:51:59 +0100 Subject: [PATCH] model classes for contract parts (Vertragsbestandteile) --- .../VertragsbestandteilBefristung.php | 89 +++++++ .../VertragsbestandteilFactory.php | 22 +- .../VertragsbestandteilFreitext.php | 107 ++++++++ .../VertragsbestandteilGehalt.php | 245 ++++++++++++++++++ .../VertragsbestandteilKarenz.php | 108 ++++++++ .../VertragsbestandteilKuendigungsfrist.php | 87 +++++++ .../VertragsbestandteilLehre.php | 65 +++++ .../VertragsbestandteilUrlaubsanspruch.php | 65 +++++ .../VertragsbestandteilZeitaufzeichnung.php | 109 ++++++++ .../Dienstverhaeltnis_model.php | 76 ++++++ .../Gehaltsbestandteil_model.php | 44 ++++ .../VertragsbestandteilBefristung_model.php | 14 + .../VertragsbestandteilFreitext_model.php | 12 + .../VertragsbestandteilKV_model.php | 12 + .../VertragsbestandteilKarenz_model.php | 14 + ...rtragsbestandteilUrlaubsanspruch_model.php | 11 + ...tragsbestandteilZeitaufzeichnung_model.php | 12 + .../Vertragsbestandteil_model.php | 43 +-- 18 files changed, 1117 insertions(+), 18 deletions(-) create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php create mode 100644 application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php create mode 100644 application/models/vertragsbestandteil/Dienstverhaeltnis_model.php create mode 100644 application/models/vertragsbestandteil/Gehaltsbestandteil_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilKV_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilKarenz_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model.php create mode 100644 application/models/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model.php diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php b/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php new file mode 100644 index 000000000..a2585b5e9 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilBefristung.php @@ -0,0 +1,89 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_BEFRISTUNG); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->befristet) && $this->setBefristet($data->befristet); + isset($data->befristet_bis) && $this->setBefristetBis($data->befristet_bis); + } + + + /** + * Get the value of befristet + */ + public function getBefristet() + { + return $this->befristet; + } + + /** + * Set the value of befristet + */ + public function setBefristet($befristet): self + { + $this->befristet = $befristet; + + return $this; + } + + /** + * Get the value of befristet_bis + */ + public function getBefristetBis() + { + return $this->befristet_bis; + } + + /** + * Set the value of befristet_bis + */ + public function setBefristetBis($befristet_bis): self + { + $this->befristet_bis = $befristet_bis; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'befristet' => $this->getBefristet(), + 'befristet_bis' => $this->getBefristetBis() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getBefristet()} + befristet_bis: {$this->getBefristetBis()} + +EOTXT; + return parent::__toString() . $txt; + } + + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php index 6a6fed451..b6ee488e7 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFactory.php @@ -13,6 +13,15 @@ class VertragsbestandteilFactory { const VERTRAGSBESTANDTEIL_STUNDEN = 'stunden'; const VERTRAGSBESTANDTEIL_FUNKTION = 'funktion'; + const VERTRAGSBESTANDTEIL_GEHALT = 'gehalt'; + const VERTRAGSBESTANDTEIL_FREITEXT = 'freitext'; + const VERTRAGSBESTANDTEIL_KARENZ = 'karenz'; + const VERTRAGSBESTANDTEIL_BEFRISTUNG = 'befristung'; + const VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST = 'kuendigungsfrist'; + const VERTRAGSBESTANDTEIL_KV = 'kv'; + const VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH = 'urlaubsanspruch'; + const VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG = 'zeitaufzeichnung'; + const VERTRAGSBESTANDTEIL_LEHRE = 'lehre'; public static function getVertragsbestandteil($data) { @@ -36,7 +45,12 @@ class VertragsbestandteilFactory $vertragsbestandteil = new VertragsbestandteilFunktion(); $vertragsbestandteil->hydrateByStdClass($data); break; - + + case self::VERTRAGSBESTANDTEIL_GEHALT: + $vertragsbestandteil = new VertragsbestandteilGehalt(); + $vertragsbestandteil->hydrateByStdClass($data); + break; + default: throw new Exception('Unknown vertragsbestandteiltyp_kurzbz ' . $vertragsbestandteiltyp_kurzbz); @@ -63,6 +77,12 @@ class VertragsbestandteilFactory 'VertragsbestandteilFunktion_model'); $vertragsbestandteildbmodel = $CI->VertragsbestandteilFunktion_model; break; + + case self::VERTRAGSBESTANDTEIL_GEHALT: + $CI->load->model('vertragsbestandteil/VertragsbestandteilGehalt_model', + 'VertragsbestandteilGehalt_model'); + $vertragsbestandteildbmodel = $CI->VertragsbestandteilGehalt_model; + break; default: throw new Exception('Unknown vertragsbestandteil_kurzbz ' diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php new file mode 100644 index 000000000..b1beefa43 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilFreitext.php @@ -0,0 +1,107 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_FREITEXT); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->anmerkung) && $this->setAnmerkung($data->anmerkung); + isset($data->kuendigungrelevant) && $this->setKuendigungrelevant($data->kuendigungrelevant); + isset($data->freitexttyp_kurzbz) && $this->setFreitexttypKurzbz($data->freitexttyp_kurzbz); + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'anmerkung' => $this->getAnmerkung(), + 'kuendigungrelevant' => $this->getKuendigungrelevant(), + 'freitexttyp_kurzbz' => $this->getFreitexttypKurzbz() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getAnmerkung()} + kuendigungrelevant: {$this->getKuendigungrelevant()} + freitexttyp_kurzbz: {$this->getFreitexttypKurzbz()} + +EOTXT; + return parent::__toString() . $txt; + } + + /** + * Get the value of anmerkung + */ + public function getAnmerkung() + { + return $this->anmerkung; + } + + /** + * Set the value of anmerkung + */ + public function setAnmerkung($anmerkung): self + { + $this->anmerkung = $anmerkung; + + return $this; + } + + /** + * Get the value of kuendigungrelevant + */ + public function getKuendigungrelevant() + { + return $this->kuendigungrelevant; + } + + /** + * Set the value of kuendigungrelevant + */ + public function setKuendigungrelevant($kuendigungrelevant): self + { + $this->kuendigungrelevant = $kuendigungrelevant; + + return $this; + } + + /** + * Get the value of freitexttyp_kurzbz + */ + public function getFreitexttypKurzbz() + { + return $this->freitexttyp_kurzbz; + } + + /** + * Set the value of freitexttyp_kurzbz + */ + public function setFreitexttypKurzbz($freitexttyp_kurzbz): self + { + $this->freitexttyp_kurzbz = $freitexttyp_kurzbz; + + return $this; + } +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php b/application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php new file mode 100644 index 000000000..cdb06b26b --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilGehalt.php @@ -0,0 +1,245 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_GEHALT); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->gehalt_von) && $this->setGehaltVon($data->gehalt_von); + isset($data->gehalt_bis) && $this->setGehaltBis($data->gehalt_bis); + isset($data->anmerkung) && $this->setAnmerkung($data->anmerkung); + isset($data->gehalt_dienstverhaeltnis_id) && $this->setGehaltDienstverhaeltnisID($data->gehalt_dienstverhaeltnis_id); + isset($data->gehaltstyp_kurzbz) && $this->setGehaltstypKurzbz($data->gehaltstyp_kurzbz); + isset($data->valorisierungssperre) && $this->setValorisierungssperre($data->valorisierungssperre); + } + + public function getGehaltVon() + { + return $this->gehalt_von; + } + + public function getGehaltBis() + { + return $this->gehalt_bis; + } + + public function setGehaltVon($von) + { + $this->gehalt_von = $von; + return $this; + } + + public function setGehaltBis($bis) + { + $this->gehalt_bis = $bis; + return $this; + } + + /** + * Get the value of gehaltsbestandteil_id + */ + public function getGehaltsbestandteilId() + { + return $this->gehaltsbestandteil_id; + } + + /** + * Set the value of gehaltsbestandteil_id + */ + public function setGehaltsbestandteilId($gehaltsbestandteil_id): self + { + $this->gehaltsbestandteil_id = $gehaltsbestandteil_id; + + return $this; + } + + /** + * Get the value of anmerkung + */ + public function getAnmerkung() + { + return $this->anmerkung; + } + + /** + * Set the value of anmerkung + */ + public function setAnmerkung($anmerkung): self + { + $this->anmerkung = $anmerkung; + + return $this; + } + + /** + * Get the value of grundbetrag + */ + public function getGrundbetrag() + { + return $this->grundbetrag; + } + + /** + * Set the value of grundbetrag + */ + public function setGrundbetrag($grundbetrag): self + { + $this->grundbetrag = $grundbetrag; + + return $this; + } + + /** + * Get the value of betrag_valorisiert + */ + public function getBetragValorisiert() + { + return $this->betrag_valorisiert; + } + + /** + * Set the value of betrag_valorisiert + */ + public function setBetragValorisiert($betrag_valorisiert): self + { + $this->betrag_valorisiert = $betrag_valorisiert; + + return $this; + } + + /** + * Get the value of valorisieren + */ + public function getValorisieren() + { + return $this->valorisieren; + } + + /** + * Set the value of valorisieren + */ + public function setValorisieren($valorisieren): self + { + $this->valorisieren = $valorisieren; + + return $this; + } + + /** + * Get the value of dienstverhaeltnis_id + */ + public function getGehaltDienstverhaeltnisID() + { + return $this->gehalt_dienstverhaeltnis_id; + } + + /** + * Set the value of dienstverhaeltnis_id + */ + public function setGehaltDienstverhaeltnisID($dienstverhaeltnis_id): self + { + $this->gehalt_dienstverhaeltnis_id = $dienstverhaeltnis_id; + + return $this; + } + + /** + * Get the value of gehaltstyp_kurzbz + */ + public function getGehaltstypKurzbz() + { + return $this->gehaltstyp_kurzbz; + } + + /** + * Set the value of gehaltstyp_kurzbz + */ + public function setGehaltstypKurzbz($gehaltstyp_kurzbz): self + { + $this->gehaltstyp_kurzbz = $gehaltstyp_kurzbz; + + return $this; + } + + /** + * Get the value of valorisierungssperre + */ + public function getValorisierungssperre() + { + return $this->valorisierungssperre; + } + + /** + * Set the value of valorisierungssperre + */ + public function setValorisierungssperre($valorisierungssperre): self + { + $this->valorisierungssperre = $valorisierungssperre; + + return $this; + } + + + + + public function toStdClass(): \stdClass + { + $tmp = array( + 'von' => $this->getVon(), + 'bis' => $this->getBis(), + 'gehalt_von' => $this->getGehaltVon(), + 'gehalt_bis' => $this->getGehaltBis(), + 'gehalt_dienstverhaeltnis_id' => $this->getGehaltDienstverhaeltnisID(), + 'grundbetrag' => $this->getGrundbetrag(), + 'betrag_valorisiert' => $this->getBetragValorisiert(), + 'valorisieren' => $this->getValorisieren(), + 'gehaltstyp_kurzbz' => $this->getGehaltstypKurzbz(), + 'valorisierungssperre' => $this->getValorisierungssperre(), + 'anmerkung' => $this->getAnmerkung() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getVon()} + bis: {$this->getBis()} + grundbetrag: {$this->getGrundbetrag()} + valorisieren: {$this->getValorisieren()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php b/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php new file mode 100644 index 000000000..3c9f7b38d --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilKarenz.php @@ -0,0 +1,108 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_KARENZ); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->karenztyp_kurzbz) && $this->setKarenztypKurzbz($data->karenztyp_kurzbz); + isset($data->geburtstermin_geplant) && $this->setGeburtsterminGeplant($data->geburtstermin_geplant); + isset($data->geburtstermin) && $this->setGeburtstermin($data->geburtstermin); + } + + /** + * Get the value of karenztyp_kurzbz + */ + public function getKarenztypKurzbz() + { + return $this->karenztyp_kurzbz; + } + + /** + * Set the value of karenztyp_kurzbz + */ + public function setKarenztypKurzbz($karenztyp_kurzbz): self + { + $this->karenztyp_kurzbz = $karenztyp_kurzbz; + + return $this; + } + + /** + * Get the value of geburtstermin + */ + public function getGeburtstermin() + { + return $this->geburtstermin; + } + + /** + * Set the value of geburtstermin + */ + public function setGeburtstermin($geburtstermin): self + { + $this->geburtstermin = $geburtstermin; + + return $this; + } + + /** + * Get the value of geburtstermin_geplant + */ + public function getGeburtsterminGeplant() + { + return $this->geburtstermin_geplant; + } + + /** + * Set the value of geburtstermin_geplant + */ + public function setGeburtsterminGeplant($geburtstermin_geplant): self + { + $this->geburtstermin_geplant = $geburtstermin_geplant; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'karenztyp_kurzbz' => $this->getKarenztypKurzbz(), + 'geburtstermin' => $this->getGeburtstermin(), + 'geburtstermin_geplant' => $this->getGeburtsterminGeplant() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getKarenztypKurzbz()} + geburtstermin: {$this->getGeburtstermin()} + geburtstermin_geplant: {$this->getGeburtsterminGeplant()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php b/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php new file mode 100644 index 000000000..18b220b37 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilKuendigungsfrist.php @@ -0,0 +1,87 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_KUENDIGUNGSFRIST); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->arbeitgeber_frist) && $this->setArbeitgeberFrist($data->arbeitgeber_frist); + isset($data->arbeitnehmer_frist) && $this->setArbeitnehmerFrist($data->arbeitnehmer_frist); + } + + /** + * Get the value of arbeitgeber_frist + */ + public function getArbeitgeberFrist() + { + return $this->arbeitgeber_frist; + } + + /** + * Set the value of arbeitgeber_frist + */ + public function setArbeitgeberFrist($arbeitgeber_frist): self + { + $this->arbeitgeber_frist = $arbeitgeber_frist; + + return $this; + } + + /** + * Get the value of arbeitnehmer_frist + */ + public function getArbeitnehmerFrist() + { + return $this->arbeitnehmer_frist; + } + + /** + * Set the value of arbeitnehmer_frist + */ + public function setArbeitnehmerFrist($arbeitnehmer_frist): self + { + $this->arbeitnehmer_frist = $arbeitnehmer_frist; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'arbeitgeber_frist' => $this->getArbeitgeberFrist(), + 'arbeitnehmer_frist' => $this->getArbeitnehmerFrist() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getArbeitgeberFrist()} + arbeitnehmer_frist: {$this->getArbeitnehmerFrist()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php new file mode 100644 index 000000000..2c665cbf5 --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLehre.php @@ -0,0 +1,65 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_LEHRE); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->inkludierte_lehre) && $this->setInkludierteLehre($data->inkludierte_lehre); + } + + /** + * Get the value of inkludierte_lehre + */ + public function getInkludierteLehre() + { + return $this->inkludierte_lehre; + } + + /** + * Set the value of inkludierte_lehre + */ + public function setInkludierteLehre($inkludierte_lehre): self + { + $this->inkludierte_lehre = $inkludierte_lehre; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'inkludierte_lehre' => $this->getInkludierteLehre(), + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getInkludierteLehre()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php new file mode 100644 index 000000000..285d7e8ad --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch.php @@ -0,0 +1,65 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->tage) && $this->setTage($data->tage); + } + + /** + * Get the value of tage + */ + public function getTage() + { + return $this->tage; + } + + /** + * Set the value of tage + */ + public function setTage($tage): self + { + $this->tage = $tage; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'tage' => $this->getTage(), + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getTage()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php b/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php new file mode 100644 index 000000000..fb715304c --- /dev/null +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung.php @@ -0,0 +1,109 @@ +setVertragsbestandteiltyp_kurzbz( + VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG); + } + + public function hydrateByStdClass($data) + { + parent::hydrateByStdClass($data); + isset($data->zeitaufzeichnung) && $this->setZeitaufzeichnung($data->zeitaufzeichnung); + isset($data->azgrelevant) && $this->setAzgrelevant($data->azgrelevant); + isset($data->homeoffice) && $this->setHomeoffice($data->homeoffice); + } + + /** + * Get the value of zeitaufzeichnung + */ + public function getZeitaufzeichnung() + { + return $this->zeitaufzeichnung; + } + + /** + * Set the value of zeitaufzeichnung + */ + public function setZeitaufzeichnung($zeitaufzeichnung): self + { + $this->zeitaufzeichnung = $zeitaufzeichnung; + + return $this; + } + + /** + * Get the value of azgrelevant + */ + public function getAzgrelevant() + { + return $this->azgrelevant; + } + + /** + * Set the value of azgrelevant + */ + public function setAzgrelevant($azgrelevant): self + { + $this->azgrelevant = $azgrelevant; + + return $this; + } + + /** + * Get the value of homeoffice + */ + public function getHomeoffice() + { + return $this->homeoffice; + } + + /** + * Set the value of homeoffice + */ + public function setHomeoffice($homeoffice): self + { + $this->homeoffice = $homeoffice; + + return $this; + } + + public function toStdClass(): \stdClass + { + $tmp = array( + 'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(), + 'zeitaufzeichnung' => $this->getZeitaufzeichnung(), + 'azgrelevant' => $this->getAzgrelevant(), + 'homeoffice' => $this->getHomeoffice() + ); + + $tmp = array_filter($tmp, function($v) { + return !is_null($v); + }); + + return (object) $tmp; + } + + public function __toString() + { + $txt = <<getZeitaufzeichnung()} + azgrelevant: {$this->getAzgrelevant()} + homeoffice: {$this->getHomeoffice()} + +EOTXT; + return parent::__toString() . $txt; + } + + +} diff --git a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php new file mode 100644 index 000000000..3c43a6fb1 --- /dev/null +++ b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php @@ -0,0 +1,76 @@ +dbTable = 'hr.tbl_dienstverhaeltnis'; + $this->pk = 'dienstverhaeltnis_id'; + } + + /** + * @return list of DV + */ + public function getDVByPersonUID($uid) + { + $result = null; + + $qry = " + SELECT + dv.dienstverhaeltnis_id, + tbl_benutzer.uid, + tbl_mitarbeiter.personalnummer, + tbl_mitarbeiter.kurzbz, + tbl_mitarbeiter.lektor, + tbl_mitarbeiter.fixangestellt, + tbl_person.person_id, + tbl_benutzer.alias, + dv.von, + dv.bis, + dv.vertragsart_kurzbz, + dv.updateamum, + dv.updatevon + FROM tbl_mitarbeiter + JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid::text = tbl_benutzer.uid::text + JOIN tbl_person USING (person_id) + JOIN hr.tbl_dienstverhaeltnis dv ON(tbl_benutzer.uid::text = dv.mitarbeiter_uid::text) + WHERE tbl_benutzer.uid=? + ORDER BY dv.von desc + "; + + return $this->execQuery($qry, array($uid)); + + } + + + public function getCurrentDVByPersonUID($uid) + { + $qry = " + SELECT + dv.dienstverhaeltnis_id, + tbl_benutzer.uid, + tbl_mitarbeiter.personalnummer, + tbl_mitarbeiter.kurzbz, + tbl_mitarbeiter.lektor, + tbl_mitarbeiter.fixangestellt, + tbl_person.person_id, + tbl_benutzer.alias, + dv.von, + dv.bis, + dv.vertragsart_kurzbz, + dv.updateamum, + dv.updatevon + FROM tbl_mitarbeiter + JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid::text = tbl_benutzer.uid::text + JOIN tbl_person USING (person_id) + JOIN hr.tbl_dienstverhaeltnis dv ON(tbl_benutzer.uid::text = dv.mitarbeiter_uid::text) + WHERE tbl_benutzer.uid=? and (dv.von<=CURRENT_DATE::text::date and (dv.bis is null OR dv.bis>=CURRENT_DATE::text::date)) + ORDER BY dv.von desc + "; + + return $this->execQuery($qry, array($uid)); + } + +} \ No newline at end of file diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php new file mode 100644 index 000000000..7b94cc56c --- /dev/null +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -0,0 +1,44 @@ +dbTable = 'hr.tbl_gehaltsbestandteil'; + $this->pk = 'gehaltsbestandteil_id'; + $encryptionkey_filename = APPPATH.'config/extensions/FHC-Core-Personalverwaltung/keys.config.inc.php'; + require($encryptionkey_filename); + } + + public function getCurrentGBTByDV($dienstverhaeltnis_id) + { + $result = null; + + $qry = " + SELECT + gehaltsbestandteil_id, + von, + bis, + anmerkung, + dienstverhaeltnis_id, + gehaltstyp_kurzbz, + valorisierungssperre, + valorisieren, + pgp_sym_decrypt(grundbetrag,?) grundbetrag, + pgp_sym_decrypt(betrag_valorisiert,?) betrag_valorisiert, + gt.bezeichnung as gehaltstyp_bezeichnung + FROM hr.tbl_gehaltsbestandteil gbt JOIN hr.tbl_gehaltstyp gt using(gehaltstyp_kurzbz) + WHERE gbt.dienstverhaeltnis_id=? AND + (gbt.von<=CURRENT_DATE::text::date and (gbt.bis is null OR gbt.bis>=CURRENT_DATE::text::date)) + ORDER BY gt.sort + "; + + return $this->execQuery($qry, array(ENCRYPTIONKEY, ENCRYPTIONKEY, $dienstverhaeltnis_id)); + + } + +} \ No newline at end of file diff --git a/application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php b/application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php new file mode 100644 index 000000000..9166b1c06 --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilBefristung_model.php @@ -0,0 +1,14 @@ +dbTable = 'hr.tbl_vertragsbestandteil_befristung'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php b/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php new file mode 100644 index 000000000..d47ce53df --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilFreitext_model.php @@ -0,0 +1,12 @@ +dbTable = 'hr.tbl_vertragsbestandteil_freitext'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilKV_model.php b/application/models/vertragsbestandteil/VertragsbestandteilKV_model.php new file mode 100644 index 000000000..197d44530 --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilKV_model.php @@ -0,0 +1,12 @@ +dbTable = 'hr.tbl_vertragsbestandteil_kv'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilKarenz_model.php b/application/models/vertragsbestandteil/VertragsbestandteilKarenz_model.php new file mode 100644 index 000000000..525291439 --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilKarenz_model.php @@ -0,0 +1,14 @@ +dbTable = 'hr.tbl_vertragsbestandteil_karenz'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model.php b/application/models/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model.php new file mode 100644 index 000000000..561ed2932 --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilUrlaubsanspruch_model.php @@ -0,0 +1,11 @@ +dbTable = 'hr.tbl_vertragsbestandteil_urlaubsanspruch'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model.php b/application/models/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model.php new file mode 100644 index 000000000..89ae0ba0a --- /dev/null +++ b/application/models/vertragsbestandteil/VertragsbestandteilZeitaufzeichnung_model.php @@ -0,0 +1,12 @@ +dbTable = 'hr.tbl_vertragsbestandteil_zeitaufzeichnung'; + $this->pk = 'vertragsbestandteil_id'; + } +} diff --git a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php index fcb41752f..b87b3ea10 100644 --- a/application/models/vertragsbestandteil/Vertragsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Vertragsbestandteil_model.php @@ -6,7 +6,7 @@ use vertragsbestandteil\VertragsbestandteilFactory; * @author bambi */ class Vertragsbestandteil_model extends DB_Model -{ +{ /** * Constructor */ @@ -16,39 +16,48 @@ class Vertragsbestandteil_model extends DB_Model $this->dbTable = 'hr.tbl_vertragsbestandteil'; $this->pk = 'vertragsbestandteil_id'; } - + public function getVertragsbestandteile($dienstverhaeltnis_id=1, $stichtag=null) { $stichtagclause = ''; - if( !is_null($stichtag) ) + if( !is_null($stichtag) ) { $date = strftime('%Y-%m-%d', strtotime($stichtag)); - $stichtagclause = 'AND ' . $this->escape($date) + $stichtagclause = 'AND ' . $this->escape($date) . ' BETWEEN COALESCE(v.von, \'1970-01-01\'::date)' . ' AND COALESCE(v.bis, \'2170-01-01\'::date)'; } - + $sql = <<escape($dienstverhaeltnis_id)} {$stichtagclause} ; EOSQL; - - echo $sql . "\n\n"; + + // echo $sql . "\n\n"; $query = $this->db->query($sql); - + $vertragsbestandteile = array(); foreach( $query->result() as $row ) { - try + try { $vertragsbestandteile[] = VertragsbestandteilFactory::getVertragsbestandteil($row); } @@ -57,7 +66,7 @@ EOSQL; echo $ex->getMessage() . "\n"; } } - + return $vertragsbestandteile; } }