Preorder statistics update

This commit is contained in:
Frank Schubert
2024-01-22 10:26:48 +01:00
parent a90de85ddf
commit 3ab04b7a20
4 changed files with 67 additions and 39 deletions
+4 -2
View File
@@ -2,7 +2,7 @@
class Preorder extends mfBaseModel {
protected $forcestr = ['street','company','zip','phone','email','note'];
private $in_after_save = false;
private $in_after_save = 0;
private $status;
private $campaign;
@@ -38,7 +38,7 @@ class Preorder extends mfBaseModel {
// prevent potential infinite loop
if($this->in_after_save) return true;
$this->in_after_save = true;
$this->in_after_save++;
// update preorder OAID if it's different from the unit OAID
// but only if the unit OAID is of the same origin as the campaign
$old_oaid = $this->oaid;
@@ -52,6 +52,8 @@ class Preorder extends mfBaseModel {
$this->cascadeStatus();
// Cascade status changes down all active preorders with the same hausnummer
$this->cascadeStatusToPreorders();
$this->in_after_save--;
}
/*