diff --git a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php index b75bdd722..930f84a64 100644 --- a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php @@ -28,9 +28,12 @@ class GehaltsbestandteilLib $this->GehaltsbestandteilModel = $this->CI->GehaltsbestandteilModel; } - public function fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) + public function fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null, + $includefuture=false, $withvalorisationhistory=true) { - return $this->GehaltsbestandteilModel->getGehaltsbestandteile($dienstverhaeltnis_id, $stichtag, $includefuture); + return $this->GehaltsbestandteilModel->getGehaltsbestandteile( + $dienstverhaeltnis_id, $stichtag, $includefuture, $withvalorisationhistory + ); } public function fetchGehaltsbestandteil($gehaltsbestandteil_id) diff --git a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php index b58c514e1..2e6182957 100644 --- a/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/VertragsbestandteilLib.php @@ -26,6 +26,8 @@ class VertragsbestandteilLib { const INCLUDE_FUTURE = true; const DO_NOT_INCLUDE_FUTURE = false; + const WITH_VALORISATION_HISTORY = true; + const NOT_WITH_VALORISATION_HISTORY = false; protected $CI; /** @var Dienstverhaeltnis_model */ @@ -90,10 +92,15 @@ class VertragsbestandteilLib return $dv; } - public function fetchVertragsbestandteile($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) + public function fetchVertragsbestandteile($dienstverhaeltnis_id, $stichtag=null, + $includefuture=false, $withvalorisationhistory=true) { - $vbs = $this->VertragsbestandteilModel->getVertragsbestandteile($dienstverhaeltnis_id, $stichtag, $includefuture); - $gbs = $this->GehaltsbestandteilLib->fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag, $includefuture); + $vbs = $this->VertragsbestandteilModel->getVertragsbestandteile( + $dienstverhaeltnis_id, $stichtag, $includefuture + ); + $gbs = $this->GehaltsbestandteilLib->fetchGehaltsbestandteile( + $dienstverhaeltnis_id, $stichtag, $includefuture, $withvalorisationhistory + ); $gbsByVBid = array(); foreach( $gbs as $gb ) diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php index f327df78b..c3d8cb174 100644 --- a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -130,9 +130,11 @@ LEFT JOIN $this->getEncryptedColumns()); } - public function getGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) + public function getGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null, + $includefuture=false, $withvalorisationhistory=true) { - if( !is_null($stichtag) && (time() > strtotime($stichtag)) ) + if( !is_null($stichtag) && (time() > strtotime($stichtag)) + && $withvalorisationhistory !== false ) { $query = $this->getGehaltsbestandteileMitValorisierungsHistorie( $dienstverhaeltnis_id, $stichtag, $includefuture