diff --git a/Layout/default/Preorder/Index.php b/Layout/default/Preorder/Index.php index c09dbb25e..561a37a11 100644 --- a/Layout/default/Preorder/Index.php +++ b/Layout/default/Preorder/Index.php @@ -58,14 +58,12 @@ -
+
@@ -258,7 +256,7 @@ type, "preorder")?>
ucode?> - Aufgenommen + status->code?> - status->name?> building_id): ?> building->street?>
building->zip?> building->city?> adb_hausnummer_id): ?> diff --git a/Layout/default/Preorder/include/preorder-detail.php b/Layout/default/Preorder/include/preorder-detail.php index 94f3537c4..f46760256 100644 --- a/Layout/default/Preorder/include/preorder-detail.php +++ b/Layout/default/Preorder/include/preorder-detail.php @@ -35,7 +35,20 @@ campaign->name?> Status: - status->code?> - status->name?> + + status->code?> - status->name?> + + OAID: oaid?> @@ -329,4 +342,42 @@
- \ No newline at end of file + + \ No newline at end of file diff --git a/Layout/default/Voiceplan/Form.php b/Layout/default/Voiceplan/Form.php index cefd5ab56..cd8a7e7e2 100644 --- a/Layout/default/Voiceplan/Form.php +++ b/Layout/default/Voiceplan/Form.php @@ -43,15 +43,17 @@ -
+ + +
- +
- ACHTUNG: Bestehende Destinations werden gelöscht! + Zonen File: + Destinations File: + id): ?>ACHTUNG: Bestehende Zonen und Destinationen werden gelöscht!
diff --git a/application/Admin/AdminController.php b/application/Admin/AdminController.php index 310515260..90fedd71f 100644 --- a/application/Admin/AdminController.php +++ b/application/Admin/AdminController.php @@ -151,7 +151,7 @@ class AdminController extends mfBaseController { } protected function ivtAdminImportAction() { - exit; + //exit; $doit = false; if($this->request->doit == 1) { $doit = true; diff --git a/application/Preorder/Preorder.php b/application/Preorder/Preorder.php index 3f4b35794..6de90e508 100644 --- a/application/Preorder/Preorder.php +++ b/application/Preorder/Preorder.php @@ -211,6 +211,8 @@ class Preorder extends mfBaseModel { return $this->ucode; } + + private function generateNewUcode() { $chars = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ'; $charsLength = strlen($chars); @@ -221,6 +223,25 @@ class Preorder extends mfBaseModel { return $ucode; } + public function createCifCode() { + $cifcode = $this->generateNewCifcode(); + while(PreorderModel::search(['cifcode' => $cifcode])) { + $cifcode = $this->generateNewCifcode(); + } + $this->cifcode = $cifcode; + return $this->cifcode; + } + + private function generateNewCifcode() { + $chars = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxzy'; + $charsLength = strlen($chars); + $cifcode = ''; + for ($i = 0; $i < 16; $i++) { + $cifcode .= $chars[rand(0, $charsLength - 1)]; + } + return $cifcode; + } + public function getApiArray() { if(!$this->id) { return false; @@ -233,6 +254,8 @@ class Preorder extends mfBaseModel { $a = []; $a['code'] = strtoupper($this->ucode); + $a['cifcode'] = $this->cifcode; + $a['cifurl'] = $this->cifurl; $a['oaid'] = $this->oaid; $a['extref'] = $this->extref; $a['status'] = $this->getProperty("status")->getApiArray(); diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index b507bc451..bdc9848b5 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -249,6 +249,15 @@ class PreorderController extends mfBaseController { unset($filter['oaid']); } + if(array_key_exists("status", $filter) && is_array($filter['status']) && count($filter['status'])) { + $new_filter['status_id'] = []; + foreach($filter["status"] as $s) { + if(is_numeric($s) && $s > 0) { + $new_filter['status_id'][] = $s; + } + } + } + /*if(array_key_exists("attributes", $filter) && count($filter['attributes'])) { }*/ @@ -785,6 +794,9 @@ class PreorderController extends mfBaseController { case "getFilteredPreorders": $return = $this->getFilteredPreordersApi(); break; + case "updateStatus": + $return = $this->updateStatusApi(); + break; default: $return = false; } @@ -926,4 +938,32 @@ class PreorderController extends mfBaseController { } + private function updateStatusApi() { + $preorder_id = $this->request->id; + + if(!is_numeric($preorder_id) || $preorder_id < 1) { + return false; + } + + $preorder = new Preorder($preorder_id); + if(!$preorder->id) { + return false; + } + + $status_id = $this->request->status_id; + if(!is_numeric($status_id) || $status_id < 1) { + return false; + } + + $status = new Preorderstatus($status_id); + if(!$status->id) { + return false; + } + + $preorder->status_id = $status_id; + $preorder->save(); + + return ["message" => "Status saved successfully", "id" => $preorder_id, "status_id" => $status->id, "status_code" => $status->code, "status_text" => $status->name]; + } + } \ No newline at end of file diff --git a/application/Preorder/PreorderModel.php b/application/Preorder/PreorderModel.php index d575cadcc..d48c920b0 100644 --- a/application/Preorder/PreorderModel.php +++ b/application/Preorder/PreorderModel.php @@ -321,21 +321,23 @@ class PreorderModel { if(array_key_exists("status_id", $filter)) { $status_id = $filter['status_id']; if(is_numeric($status_id)) { - $where .= " AND status_id=$status_id"; + $where .= " AND tt_preorder.status_id=$status_id"; + } elseif(is_array($status_id)) { + $where .= " AND tt_preorder.status_id IN (". implode(",", $status_id).")"; } } if(array_key_exists("status_id", $filter)) { $status_id = $filter['>status_id']; if(is_numeric($status_id)) { - $where .= " AND status_id > $status_id"; + $where .= " AND tt_preorder.status_id > $status_id"; } } @@ -455,6 +457,13 @@ class PreorderModel { } } + if(array_key_exists("cifcode", $filter)) { + $cifcode = FronkDB::singleton()->escape($filter['cifcode']); + if($cifcode) { + $where .= " AND cifcode LIKE '$cifcode'"; + } + } + if(array_key_exists("oaid", $filter)) { $oaid = $filter['oaid']; if($oaid) { diff --git a/application/Preorderstatus/PreorderstatusModel.php b/application/Preorderstatus/PreorderstatusModel.php index 01a4fb49d..e2231eaad 100644 --- a/application/Preorderstatus/PreorderstatusModel.php +++ b/application/Preorderstatus/PreorderstatusModel.php @@ -44,7 +44,7 @@ class PreorderstatusModel { public static function getAll() { $items = []; - $db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME); + $db = FronkDB::singleton(); $res = $db->select("Preorderstatus", "*"); if($db->num_rows($res)) { @@ -57,7 +57,7 @@ class PreorderstatusModel { } public static function getFirst($filter = false) { - $db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME); + $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); $res = $db->select("Preorderstatus", "*", "$where ORDER BY code, name"); @@ -74,7 +74,7 @@ class PreorderstatusModel { } public static function count($filter) { - $db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME); + $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); $sql = "SELECT COUNT(*) as cnt FROM Preorderstatus @@ -93,7 +93,7 @@ class PreorderstatusModel { public static function search($filter, $limit = false) { $items = []; - $db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME); + $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); diff --git a/application/Voiceplan/Voiceplan.php b/application/Voiceplan/Voiceplan.php index 5a962148c..b40d1ebbf 100644 --- a/application/Voiceplan/Voiceplan.php +++ b/application/Voiceplan/Voiceplan.php @@ -65,6 +65,44 @@ class Voiceplan extends mfBaseModel { } } + public function importZonesFromCsv(File $file) { + if(!$this->id) { + return false; + } + try { + $i = 0; + $filename = $file->getFullPath(); + $input = fopen($filename, "r"); + while($csv = fgetcsv($input, 0, ",")) { + $i++; + if($i == 1) continue; + + if(!trim($csv[0])) { + continue; + } + + $name = trim($csv[0]); + $prefix = trim($csv[1]); + $price_ek = str_replace(",",".", trim($csv[2])); + $price_vk = str_replace(",",".", trim($csv[3])); + + if(!$name || !$prefix || !$price_ek || !$price_vk) { + $this->log->warning("not Importing Voiceplandestination with empty value: destination: $name | prefix: $prefix | ek: $price_ek | vk: $price_vk"); + continue; + } + + + + } + return true; + + + } catch(Exception $e) { + echo $e->getCode().": ".$e->getMessage();exit; + return false; + } + } + public function getProperty($name) { if($this->$name == null) { diff --git a/application/Voiceplan/VoiceplanController.php b/application/Voiceplan/VoiceplanController.php index 4cdc5cf54..9975cbc8d 100644 --- a/application/Voiceplan/VoiceplanController.php +++ b/application/Voiceplan/VoiceplanController.php @@ -125,7 +125,7 @@ class VoiceplanController extends mfBaseController { $data['name'] = $r->name; $data['description'] = $r->description; - if($r->increment) { + /*if($r->increment) { $increments = explode("/",$r->increment); if(count($increments) != 2) { $this->layout()->setFlash("Ungültige Taktung", "error"); @@ -134,7 +134,7 @@ class VoiceplanController extends mfBaseController { $data["increment_first"] = $increments[0]; $data["increment"] = $increments[1]; - } + }*/ if(!$data['name']) { $this->layout()->setFlash("Bitte Name eingeben", "error"); @@ -153,39 +153,69 @@ class VoiceplanController extends mfBaseController { return $this->editAction(); } - - if(is_array($_FILES) && array_key_exists("voiceplanfile", $_FILES) && !$_FILES['voiceplanfile']['error']) { + // import zones + if(is_array($_FILES) && array_key_exists("voiceplanzonefile", $_FILES) && !$_FILES['voiceplanzonefile']['error']) { // look for uploaded import file try { // returns File object or throws Exception on error - $file = mfUpload::handleFormUpload("voiceplanfile"); + $file = mfUpload::handleFormUpload("voiceplanzonefile"); } catch (Exception $ex) { - $this->layout()->setFlash("Fehler beim Dateiupload: ".$ex->getMessage(), "error"); + $this->layout()->setFlash("Fehler beim Upload des Zonenfiles: ".$ex->getMessage(), "error"); return $this->editAction(); } - + $vpf = VoiceplanFileModel::create([ 'voiceplan_id' => $id, 'file_id' => $file->id, - 'name' => "voiceplan-import-".date("Y-m-d_H-i-s").".csv", + 'name' => "voiceplan-zone-import-".date("Y-m-d_H-i-s").".csv", ]); - $voiceplanfile_id = $vpf->save(); - if(!$voiceplanfile_id) { + $voiceplanzonefile_id = $vpf->save(); + if(!$voiceplanzonefile_id) { $this->layout()->setFlash("Fehler beim Speichern der hochgeladenen Datei", "error"); return $this->editAction(); } - - // if file was uploaded successfully, delete old destinations + // if file was uploaded successfully, delete old destinations and zones foreach(VoiceplandestinationModel::search(['voiceplan_id' => $id]) as $destination) { $destination->delete(); - + } + foreach(VoiceplanzoneModel::search(['voiceplan_id' => $id]) as $zone) { + $zone->delete(); } - if(!$voiceplan->importDestinationsFromCsv($file)) { - $this->layout()->setFlash("Fehler beim Importieren!", "error"); + + if(!$voiceplan->importZonesFromCsv($file)) { + $this->layout()->setFlash("Fehler beim Importieren der Zonen!", "error"); return $this->editAction(); } + + // import destinations + if(is_array($_FILES) && array_key_exists("voiceplandestinationfile", $_FILES) && !$_FILES['voiceplandestinationfile']['error']) { + // look for uploaded import file + try { + // returns File object or throws Exception on error + $file = mfUpload::handleFormUpload("voiceplandestinationfile"); + } catch (Exception $ex) { + $this->layout()->setFlash("Fehler beim Upload des Destinationfiles: ".$ex->getMessage(), "error"); + return $this->editAction(); + } + + $vpf = VoiceplanFileModel::create([ + 'voiceplan_id' => $id, + 'file_id' => $file->id, + 'name' => "voiceplan-dest-import-".date("Y-m-d_H-i-s").".csv", + ]); + $voiceplandestinationfile_id = $vpf->save(); + if(!$voiceplandestinationfile_id) { + $this->layout()->setFlash("Fehler beim Speichern der hochgeladenen Datei", "error"); + return $this->editAction(); + } + + if(!$voiceplan->importDestinationsFromCsv($file)) { + $this->layout()->setFlash("Fehler beim Importieren!", "error"); + return $this->editAction(); + } + } } $this->layout()->setFlash("Sprachtarifpaket erfolgreich gespeichert!", "success"); diff --git a/application/Voiceplandestination/VoiceplandestinationModel.php b/application/Voiceplandestination/VoiceplandestinationModel.php index 2d6d7218b..c2624ba7d 100644 --- a/application/Voiceplandestination/VoiceplandestinationModel.php +++ b/application/Voiceplandestination/VoiceplandestinationModel.php @@ -70,8 +70,12 @@ class VoiceplandestinationModel { $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); - $sql = "SELECT COUNT(*) as cnt FROM Voiceplandestination - WHERE $where + $sql = "SELECT COUNT(*) as cnt FROM ( + SELECT Voiceplandestination.id FROM Voiceplandestination + LEFT JOIN Voiceplanzone ON (Voiceplanzone.id = Voiceplandestination.voiceplanzone_id) + WHERE $where + GROUP BY Voiceplandestination.id + ) as v "; $res = $db->query($sql); @@ -87,7 +91,8 @@ class VoiceplandestinationModel { $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); - $sql = "SELECT * FROM Voiceplandestination + $sql = "SELECT Voiceplandestination.* FROM Voiceplandestination + LEFT JOIN Voiceplanzone ON (Voiceplanzone.id = Voiceplandestination.voiceplanzone_id) WHERE $where ORDER BY destination,prefix"; @@ -126,6 +131,13 @@ class VoiceplandestinationModel { } } + if(array_key_exists("voiceplan_id", $filter)) { + $voiceplan_id = $filter['voiceplan_id']; + if(is_numeric($voiceplan_id)) { + $where .= " AND Voiceplanzone.voiceplan_id = $voiceplan_id"; + } + } + if(array_key_exists("name", $filter)) { $name = $db->escape($filter['name']); if($name) { diff --git a/db/migrations/20231010161225_add_voiceplan_zone.php b/db/migrations/20231010161225_add_voiceplan_zone.php index 276c7aac0..a7edb17d9 100644 --- a/db/migrations/20231010161225_add_voiceplan_zone.php +++ b/db/migrations/20231010161225_add_voiceplan_zone.php @@ -28,6 +28,17 @@ final class AddVoiceplanZone extends AbstractMigration $table->removeColumn("increment"); $table->renameColumn("voiceplan_id", "voiceplanzone_id"); $table->update(); + + $table = $this->table("VoiceplanFile"); + $table->addColumn("voiceplan_id", "integer", ["null" => false]); + $table->addColumn("file_id", "integer", ["null" => false]); + $table->addColumn("name", "string", ["null" => false, "limit" => 255]); + $table->addColumn("description", "text", ["null" => true, "default" => null]); + $table->addColumn("create_by", "integer", ["null" => false]); + $table->addColumn("edit_by", "integer", ["null" => false]); + $table->addColumn("create", "integer", ["null" => false]); + $table->addColumn("edit", "integer", ["null" => false]); + $table->create(); } if($this->getEnvironment() == "addressdb") { @@ -38,6 +49,8 @@ final class AddVoiceplanZone extends AbstractMigration public function down(): void { if($this->getEnvironment() == "thetool") { + $this->table("VoiceplanFile")->drop()->save(); + $table = $this->table("Voiceplandestination"); $table->renameColumn("voiceplanzone_id", "voiceplan_id"); $table->addColumn("purchase_price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]); diff --git a/db/migrations/20231031135229_add_contract_tables.php b/db/migrations/20231031135229_add_contract_tables.php index b11c97e3a..1789a51d3 100644 --- a/db/migrations/20231031135229_add_contract_tables.php +++ b/db/migrations/20231031135229_add_contract_tables.php @@ -23,9 +23,9 @@ final class AddContractTables extends AbstractMigration $contract->addColumn("product_external", "integer", ["null" => false, "default" => 0, "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]); $contract->addColumn("product_external_id", "integer", ["null" => true, "default" => null]); $contract->addColumn("price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]); - $contract->addColumn("price_setup", "decimal", ["null" => false, "precision" => 14, "scale" => 4]); - $contract->addColumn("price_nne", "decimal", ["null" => false, "default" => null, "precision" => 14, "scale" => 4]); - $contract->addColumn("price_nbe", "decimal", ["null" => false, "default" => null, "precision" => 14, "scale" => 4]); + $contract->addColumn("price_setup", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]); + $contract->addColumn("price_nne", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]); + $contract->addColumn("price_nbe", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]); $contract->addColumn("billing_delay", "integer", ["null" => false, "default" => 0]); $contract->addColumn("billing_period", "integer", ["null" => false, "default" => 1]); $contract->addColumn("order_date", "integer", ["null" => true, "default" => null]); @@ -102,7 +102,7 @@ final class AddContractTables extends AbstractMigration $cj = $this->table("Contractjournal"); $cj->addColumn("contract_id", "integer", ["null" => false]); $cj->addColumn("type", "string", ["null" => false, "limit" => 64]); - $cj->addColumn("string", "string", ["null" => true, "default" => null, "limit" => 64]); + $cj->addColumn("value", "string", ["null" => true, "default" => null, "limit" => 64]); $cj->addColumn("text", "text", ["null" => true, "default" => null]); $cj->addColumn("create_by", "integer", ["null" => false]); $cj->addColumn("edit_by", "integer", ["null" => false]); diff --git a/db/migrations/20231103123714_preorder_add_cif_token.php b/db/migrations/20231103123714_preorder_add_cif_token.php new file mode 100644 index 000000000..cc2354471 --- /dev/null +++ b/db/migrations/20231103123714_preorder_add_cif_token.php @@ -0,0 +1,35 @@ +getEnvironment() == "thetool") { + $table = $this->table("Preorder"); + $table->addColumn("ciftoken", "string", ["null" => true, "default" => null, "limit" => 64, "after" => "ucode"]); + $table->addColumn("cifurl", "string", ["null" => true, "default" => null, "limit" => 255, "after" => "ciftoken"]); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $table = $this->table("Preorder"); + $table->removeColumn("cifurl"); + $table->removeColumn("ciftoken"); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +} diff --git a/public/assets/css/thetool.css b/public/assets/css/thetool.css index b8789c5da..a5a41851c 100644 --- a/public/assets/css/thetool.css +++ b/public/assets/css/thetool.css @@ -173,6 +173,14 @@ h1, h2, h3, h4, h5, h6 { margin-right: 5px !important; } +.select2-results > .select2-results__options { + max-height: 400px !important; +} + +.select2-container--default .select2-results > .select2-results__options { + max-height: 400px !important; +} + #banned_rimo_fcp + .select2-container .select2-selection--multiple .select2-selection__choice { background-color: var(--red) !important; } diff --git a/public/docs/preorder-api.yaml b/public/docs/preorder-api.yaml index bcc775559..73f647739 100644 --- a/public/docs/preorder-api.yaml +++ b/public/docs/preorder-api.yaml @@ -638,15 +638,15 @@ paths: $ref: '#/components/schemas/preorderStatusDetail' '401': description: Unauthorized - /preorder/{code}: + /preorder/{id}: get: tags: - preorder summary: Details und Status zur Vorbestellung - description: Gibt Details zum Status der Vorbestellung/Bestellung zurück + description: Gibt Details zum Status der Vorbestellung/Bestellung zurück. id kann automatisch generierter **code** der Vorbestellung, **OAID** der Wohneinheit oder providereigene ID (**extref**) sein. operationId: getPreorderStatus parameters: - - name: code + - name: id in: path description: Automatisch generierter **code** der Vorbestellung, **OAID** der Wohneinheit oder providereigene ID (**extref**) required: true @@ -708,7 +708,7 @@ paths: description: Erstellt einen Storno Request operationId: cancelPreorder parameters: - - name: code + - name: id in: path description: Automatisch generierter **code** der Vorbestellung, **OAID** der Wohneinheit oder providereigene ID (**extref**) required: true @@ -739,6 +739,48 @@ paths: description: Keine Berechtigung oder Storno Request bereits vorhanden '404': description: Bestellung nicht gefunden oder bereits storniert + /preorder/{id}/clientIntallationFinished: + post: + tags: + - preorder + summary: Bestellung auf Status 200 - Rohr im Gebäude setzen + description: Setzt Status der Bestellung auf 200 - Rohr im Gebäude. Wird gesetzt wenn beim Kunden die Lehrrohrinstallation abgeschlossen ist. + operationId: setClientIntallationFinished + parameters: + - name: id + in: path + description: Automatisch generierter **code** der Vorbestellung, **OAID** der Wohneinheit oder providereigene ID (**extref**) + required: true + schema: + type: string + responses: + '200': + description: Successful operation + '401': + description: Unauthorized + '404': + description: Vorbestellung nicht gefunden + /preorder/{id}/inhouseInstallationFinished: + post: + tags: + - preorder + summary: Bestellung auf Status 500 - Fertiggestellt setzen + description: Setzt Status der Bestellung auf 500 - Fertiggestellt. Wird gesetzt, wenn beim Kunden alle Installationsarbeiten abgeschlossen sind und der Service aktiv ist. + operationId: setInhouseIntallationFinished + parameters: + - name: id + in: path + description: Automatisch generierter **code** der Vorbestellung, **OAID** der Wohneinheit oder providereigene ID (**extref**) + required: true + schema: + type: string + responses: + '200': + description: Successful operation + '401': + description: Unauthorized + '404': + description: Vorbestellung nicht gefunden components: schemas: timestampString: @@ -1371,6 +1413,14 @@ components: type: string description: Statustext example: Fiber installation work assigned + ciftoken: + type: string + description: Customer Installation Feedback Token + example: "XArjnWQXGq4a8JWF" + cifurl: + type: string + description: Customer Installation Feedback Url + example: "https://pro.ichwillglasfaser.at/ClientSubmit/finishedInstallationWork?c=XArjnWQXGq4a8JWF" connectionType: type: string enum: [single-dwelling, multi-dwelling, apartment-building, apartment, business] diff --git a/scripts/addressdb/premstaetten-sued/01-addressdb_update_buildings.php b/scripts/addressdb/premstaetten-sued/01-addressdb_update_buildings.php index b1455e5de..b34cef8fe 100755 --- a/scripts/addressdb/premstaetten-sued/01-addressdb_update_buildings.php +++ b/scripts/addressdb/premstaetten-sued/01-addressdb_update_buildings.php @@ -110,6 +110,10 @@ while($csv = fgetcsv($input, 0, ";")) { $strasse_name = trim($m[1]); } + if($hausnummer_extref == "25012392") { + // Zettling 53 is 25011191, would be overwritten with this extref + continue; + } if($strasse_name == "GST") continue; if(preg_match('/^L\d+/',$strasse_name) && !$adrcd) continue; diff --git a/scripts/test.php b/scripts/test.php index 3da336a9b..63cee79ab 100644 --- a/scripts/test.php +++ b/scripts/test.php @@ -15,23 +15,7 @@ $me = new User(1); define("INTERNAL_USER_ID", $me->id); define("INTERNAL_USER_USERNAME", $me->username); -$contract = new Contract(22); -require_once(APPDIR."Contractconfig/hooks/Contractconfig_Hook.php"); -require_once(APPDIR."Contractconfig/hooks/Voicenumberblock.php"); - -$hook = new Contractconfig_Hook_Voicenumberblock($contract); - -if(!$hook->isResponsible()) { - echo "is responsible: no\n"; - exit; -} else { - $hook->afterSave(); -} -if($hook->errors) { - echo "Fehler beim speichern: \n"; - foreach($hook->errors as $error) { - echo $error."\n"; - } - exit; -} -echo "All done.\n"; \ No newline at end of file +$preorder = new Preorder(5458); +$preorder->createCifCode(); +echo $preorder->cifcode; +echo "\n"; \ No newline at end of file