Added preorder import Stiftingtal

This commit is contained in:
Frank Schubert
2024-04-08 16:52:23 +02:00
parent 059b26ba33
commit 6340d17db2
4 changed files with 514 additions and 7 deletions

View File

@@ -60,13 +60,17 @@ class Preorder extends mfBaseModel {
public function runStatusTrigger() {
if(!$this->id) return true;
if($this->status_id == $this->_old_data->status_id) return true;
if(property_exists($this->_old_data, "status_id") && $this->status_id == $this->_old_data->status_id) return true;
$this->log->debug(__METHOD__." running");
$new_status = $this->getProperty("status");
if(!property_exists($this->_old_data, "status_id")) {
return true;
}
$old_status = new Preorderstatus($this->_old_data->status_id);
if(!$new_status->id || !$old_status->id) return true;
$this->log->debug(__METHOD__." status changed from '".($old_status ? $old_status->code : "")."' to '".$new_status->code."'");