Added status to Adressdb export; added loading indicator in Preorder

detail view
This commit is contained in:
Frank Schubert
2023-11-09 17:04:07 +01:00
parent 19cd396175
commit f59f3f026a
7 changed files with 108 additions and 11 deletions
+21 -3
View File
@@ -966,8 +966,26 @@ class PreorderController extends mfBaseController {
$preorder->status_id = $status_id;
$preorder->save();
$update = [];
$update = [
foreach(PreorderModel::search(["deleted" => 0, "adb_hausnummer_id" => $preorder->adb_hausnummer_id]) as $affected_preorder) {
$up = [
"id" => $affected_preorder->id,
"sid" => $affected_preorder->status_id,
"code" => $affected_preorder->status->code,
"text" => $affected_preorder->status->name,
"bcode" => $affected_preorder->adb_hausnummer->status->code,
"btext" => $affected_preorder->adb_hausnummer->status->name,
];
if($preorder->adb_wohneinheit_id) {
$up["ucode"] = $affected_preorder->adb_wohneinheit->status->code;
$up["utext"] = $affected_preorder->adb_wohneinheit->status->name;
}
$update[] = $up;
}
/* $update = [
"preorder" => [
"status" => [
"id" => $status->id,
@@ -996,8 +1014,8 @@ class PreorderController extends mfBaseController {
]
];
}
return ["message" => "Status saved successfully", "id" => $preorder_id, "update" => $update];
*/
return ["message" => "Status saved successfully", "id" => $preorder_id, "updates" => $update];
}
private function deleteWorkorderApi() {