Invoice/Index layout tweak

This commit is contained in:
Frank Schubert
2024-10-02 12:54:29 +02:00
parent fa404eec3c
commit a56983824f

View File

@@ -483,12 +483,14 @@ foreach ($clusters as $cluster_data) {
if(property_exists($service, "customerState") && is_object($service->customerState) && property_exists($service->customerState, "userLabel") && strtolower($service->customerState->userLabel) == "active") {
// active => order 500
$preorder = \PreorderModel::getFirst(["adb_wohneinheit_id" => $unit->id]);
$preorder->resetSaveNesting();
if($preorder) {
$new_status = \PreorderstatusModel::getFirst(["code" => 500]);
if($new_status) {
if($preorder->status->code < $new_status->code) {
$preorder->status_id = $new_status->id;
$preorder->save();
$preorder->resetSaveNesting();
}
}
}