Corrected: No genehmigt_von and update info when Anrechnung is rejected

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-01-20 13:15:28 +01:00
committed by cris-technikum
parent f0ef091c5f
commit 1bd66d0ee2
+3 -20
View File
@@ -218,29 +218,12 @@ class AnrechnungLib
return success(false); // dont reject
}
// Start DB transaction
$this->ci->db->trans_start(false);
// Insert new status approved
// Insert new status rejected
$result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_REJECTED);
// Update genehmigt von
$result = $this->ci->AnrechnungModel->update(
$anrechnung_id,
array(
'genehmigt_von' => getAuthUID(),
'updateamum' => (new DateTime())->format('Y-m-d H:m:i'),
'updatevon' => getAuthUID()
)
);
// Transaction complete!
$this->ci->db->trans_complete();
if ($this->ci->db->trans_status() === false || isError($result))
if (isError($result))
{
$this->ci->db->trans_rollback();
show_error($result->msg, EXIT_ERROR);
show_error(getError($result));
}
return success(true); // rejected