PreorderstatusJournal & preorder flags -> ADBHausnummer flags sync
This commit is contained in:
@@ -223,7 +223,9 @@ class AddressDB {
|
||||
// seems all criteria match => set new status
|
||||
|
||||
$log->debug(__METHOD__.": new Preorder Status: ".$matrix["p"]);
|
||||
$log->debug(__METHOD__.": new Preorder Status flag: ".$matrix["pf"]);
|
||||
if(array_key_exists("pf", $matrix)) {
|
||||
$log->debug(__METHOD__ . ": new Preorder Status flag: " . $matrix["pf"]);
|
||||
}
|
||||
|
||||
$preorder = PreorderModel::getFirstActive(["adb_wohneinheit_id" => $wohneinheit->id]);
|
||||
|
||||
@@ -245,8 +247,16 @@ class AddressDB {
|
||||
$preorder->resetSaveNesting();
|
||||
}
|
||||
if($preorderstatus_flag) {
|
||||
$psflag = PreorderStatusflagModel::getFirst(["code" => $preorderstatus_flag]);
|
||||
$log->debug(__METHOD__.": Setting Preorder Status Flag ".$preorderstatus_flag);
|
||||
$preorder->setStatusFlag($preorderstatus_flag);
|
||||
if(array_key_exists($psflag->id, $preorder->statusflags)) {
|
||||
if(!$preorder->statusflags[$psflag->id]->value->value) {
|
||||
$preorder->setStatusFlag($preorderstatus_flag);
|
||||
}
|
||||
} else {
|
||||
$preorder->setStatusFlag($preorderstatus_flag);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
$sflag = PreorderStatusflagModel::getFirst(["code" => $preorderstatus_flag]);
|
||||
|
||||
Reference in New Issue
Block a user