mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
added function to get chart data
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
namespace vertragsbestandteil;
|
||||
|
||||
use DateTimeImmutable;
|
||||
|
||||
/**
|
||||
* Salary always depends on employment (Dienstverhältnis) and optionally on part of contract (Vetragsbestandteil)
|
||||
*/
|
||||
@@ -84,6 +86,21 @@ class Gehaltsbestandteil implements IValidation, \JsonSerializable
|
||||
return $this->bis;
|
||||
}
|
||||
|
||||
public function getVonDateTime()
|
||||
{
|
||||
return $this->toDateTime($this->von);
|
||||
}
|
||||
|
||||
public function getBisDateTime()
|
||||
{
|
||||
return $this->toDateTime($this->bis);
|
||||
}
|
||||
|
||||
protected function toDateTime($d) {
|
||||
if ($d == null) return null;
|
||||
return new DateTimeImmutable($d);
|
||||
}
|
||||
|
||||
public function getAnmerkung()
|
||||
{
|
||||
return $this->anmerkung;
|
||||
|
||||
@@ -71,13 +71,14 @@ class Gehaltsbestandteil_model extends DB_Model implements IEncryption
|
||||
$this->getEncryptedColumns());
|
||||
}
|
||||
|
||||
public function getGBTChartDataByDV($dienstverhaeltnis_id)
|
||||
public function getGBTChartDataByDV_old($dienstverhaeltnis_id)
|
||||
{
|
||||
|
||||
$qry = "
|
||||
WITH gbt as
|
||||
(select von,bis,grundbetrag as grund_betrag_decrypted from hr.tbl_gehaltsbestandteil where dienstverhaeltnis_id=?)
|
||||
select von,bis, (select sum(gbt.grund_betrag_decrypted) as sum_betrag from gbt where gbt.von<=gbtmeta.von and (gbt.bis is null or gbt.bis>=gbtmeta.von)
|
||||
select von,bis, (select sum(gbt.grund_betrag_decrypted) as sum_betrag
|
||||
from gbt where gbt.von<=gbtmeta.von and (gbt.bis is null or gbt.bis>=gbtmeta.von)
|
||||
) as summe from gbt as gbtmeta order by von,bis
|
||||
";
|
||||
|
||||
@@ -85,6 +86,7 @@ class Gehaltsbestandteil_model extends DB_Model implements IEncryption
|
||||
array($dienstverhaeltnis_id),
|
||||
$this->getEncryptedColumns());
|
||||
}
|
||||
|
||||
|
||||
public function getGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null, $includefuture=false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user