add parameter withvalorisationhistory to use valorisation history or not

This commit is contained in:
Harald Bamberger
2025-01-23 15:31:17 +01:00
parent af79090de0
commit c5d79f750e
3 changed files with 19 additions and 7 deletions
@@ -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)
@@ -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 )
@@ -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