Skip to content
Code-Schnipsel Gruppen Projekte
Commit 9686c711 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: #2 - Set history when status changes

Übergeordneter 0c5e25d5
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -308,7 +308,33 @@ public function update($PermissionUser = null)
$data = $this->getDataForSaving();
QUI::getEvents()->fireEvent('quiqqerOrderUpdateBegin', [$this, $data]);
QUI::getEvents()->fireEvent(
'quiqqerOrderUpdateBegin',
[$this, $data]
);
// set status change
if ($this->statusChanged) {
$status = $this->status;
try {
$Status = QUI\ERP\Order\ProcessingStatus\Handler::getInstance()->getProcessingStatus($status);
$status = $Status->getTitle();
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeDebugException($Exception);
}
$this->History->addComment(
QUI::getLocale()->get(
'quiqqer/order',
'message.change.order.status',
[
'status' => $status,
'statusId' => $this->status
]
)
);
}
QUI::getDataBase()->update(
Handler::getInstance()->table(),
......
......@@ -100,13 +100,24 @@ public function update($PermissionUser = null)
[$this, $data]
);
// set status change
if ($this->statusChanged) {
$status = $this->status;
try {
$Status = QUI\ERP\Order\ProcessingStatus\Handler::getInstance()->getProcessingStatus($status);
$status = $Status->getTitle();
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeDebugException($Exception);
}
$this->History->addComment(
QUI::getLocale()->get(
'quiqqer/order',
'message.change.order.status',
[
'status' => $this->status
'status' => $status,
'statusId' => $this->status
]
)
);
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren