fix disappearing searchbar when session expires, add functions to fetch dvs at a certain duedate for valorisation

This commit is contained in:
Harald Bamberger
2024-03-25 16:53:03 +01:00
parent 2a26765ff6
commit d4bc5148a7
5 changed files with 31 additions and 4 deletions
@@ -143,7 +143,7 @@ EODVIDC;
AND
dv.oe_kurzbz = ?
AND
dv.vertragsart_kurzbz != 'werkvertrag'
dv.vertragsart_kurzbz NOT IN ('werkvertrag', 'studentischehilfskr')
AND
?::date <= COALESCE(dv.bis, '2170-12-31'::date)
AND
@@ -224,4 +224,22 @@ EOSQL;
}
public function fetchDienstverhaeltnisse($unternehmen, $stichtag=null, $mitarbeiteruid=null) {
$where = "oe_kurzbz = " . $this->escape($unternehmen);
if( !is_null($stichtag) )
{
$where .= " AND " . $this->escape($stichtag) . " BETWEEN COALESCE(von, '1970-01-01') AND COALESCE(bis, '2070-12-31')";
}
if( !is_null($mitarbeiteruid) )
{
$where .= " AND mitarbeiter_uid = " . $this->escape($mitarbeiteruid);
}
$res = $this->loadWhere($where);
$dvs = array();
if(hasData($res) )
{
$dvs = getData($res);
}
return $dvs;
}
}