Corrected: No genehmigt_von and update info when Anrechnung is rejected

Signed-off-by: cris-technikum <[email protected]>
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 return success(false); // dont reject
} }
// Start DB transaction // Insert new status rejected
$this->ci->db->trans_start(false);
// Insert new status approved
$result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_REJECTED); $result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_REJECTED);
// Update genehmigt von if (isError($result))
$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))
{ {
$this->ci->db->trans_rollback(); show_error(getError($result));
show_error($result->msg, EXIT_ERROR);
} }
return success(true); // rejected return success(true); // rejected