change datum_von of benutzerfunktion if vb gueltig_ab is earlier

This commit is contained in:
Harald Bamberger
2023-10-13 16:45:30 +02:00
parent 41a51ee286
commit dcb308a535
@@ -47,6 +47,14 @@ class VertragsbestandteilFunktion extends Vertragsbestandteil
'updateamum' => strftime('%Y-%m-%d %H:%M:%S'),
'updatevon' => getAuthUID()
);
$curbfres = $this->CI->BenutzerfunktionModel->load($this->getBenutzerfunktion_id());
$curbf = (getData($curbfres))[0];
if( $curbf && ($this->getVon() < $curbf->datum_von) )
{
$data->datum_von = $this->getVon();
}
$ret = $this->CI->BenutzerfunktionModel->update($this->getBenutzerfunktion_id(), $data);
if(isError($ret) )