reload Vertragsstatus if change of mitarbeiter

This commit is contained in:
ma0068
2025-07-02 11:54:32 +02:00
parent 56e8a34d68
commit 411b97fa14
5 changed files with 26 additions and 7 deletions
@@ -75,8 +75,20 @@ class Vertraege extends FHCAPI_Controller
$this->terminateWithSuccess((getData($result) ?: []));
}
public function getStatiOfContract($vertrag_id)
public function getStatiOfContract($person_id, $vertrag_id)
{
//check if vertrag_id corresponds with person_id and return null if not
$result = $this->VertragModel->loadWhere(
array(
'vertrag_id' => $vertrag_id,
'person_id' => $person_id
)
);
if(!hasData($result))
{
$this->terminateWithSuccess([]);
}
$result = $this->VertragModel->getStatiOfContract($vertrag_id);
if (isError($result)) {