Added Preorderselfservice API

This commit is contained in:
Frank Schubert
2024-12-11 15:45:46 +01:00
parent 2154b326c2
commit 2c4a84b95d
3 changed files with 112 additions and 1 deletions
+20 -1
View File
@@ -959,11 +959,14 @@ class Preorder extends mfBaseModel {
}
$include_full_home = false;
$include_full_address = false;
if(in_array("full_home", $options)) {
$include_full_home = true;
}
if(in_array("full_address", $options)) {
$include_full_address = true;
}
$hausnummer = $this->getProperty("adb_hausnummer");
$wohneinheit = $this->getProperty("adb_wohneinheit");
@@ -1020,6 +1023,22 @@ class Preorder extends mfBaseModel {
unset($address['municipality']);
}
if($include_full_address) {
$address['gps_lat'] = $hausnummer->gps_lat;
$address['gps_long'] = $hausnummer->gps_long;
$address["borderpoint_lat"] = $hausnummer->borderpoint_lat;
$address["borderpoint_long"] = $hausnummer->borderpoint_long;
$address["trenches"] = [];
$address["home_trench"] = [];
if($hausnummer->trenches) {
$address["trenches"] = json_decode($hausnummer->trenches);
}
if($hausnummer->home_trench) {
$address["home_trench"] = json_decode($hausnummer->home_trench);
}
}
if(!$include_full_home) {
$address['block'] = ($wohneinheit->block) ? $wohneinheit->block : null;
$address['stock'] = ($wohneinheit->stock) ? $wohneinheit->stock : null;