diff --git a/Layout/default/Voiceplan/Index.php b/Layout/default/Voiceplan/Index.php
index 903a76afa..42d7110f7 100644
--- a/Layout/default/Voiceplan/Index.php
+++ b/Layout/default/Voiceplan/Index.php
@@ -71,6 +71,7 @@
| =$destination->destination?> |
- =$destination->prefix?> |
+ +=$destination->prefix?> |
=date("d.m.Y H:i", $zone->create)?> (=$zone->creator->name?>) |
=date("d.m.Y H:i", $zone->edit)?> (=$zone->editor->name?>) |
diff --git a/application/Voiceplan/Voiceplan.php b/application/Voiceplan/Voiceplan.php
index e5c3b2ab9..9206864f5 100644
--- a/application/Voiceplan/Voiceplan.php
+++ b/application/Voiceplan/Voiceplan.php
@@ -19,7 +19,7 @@ class Voiceplan extends mfBaseModel {
$i = 0;
$filename = $file->getFullPath();
$input = fopen($filename, "r");
- while($csv = fgetcsv($input, 0, ";")) {
+ while($csv = fgetcsv($input, 0, ",")) {
$i++;
if($i == 1) continue;
@@ -95,14 +95,13 @@ class Voiceplan extends mfBaseModel {
$i = 0;
$filename = $file->getFullPath();
$input = fopen($filename, "r");
- while($csv = fgetcsv($input, 0, ";")) {
+ while($csv = fgetcsv($input, 0, ",")) {
$i++;
if($i == 1) continue;
if(!trim($csv[0])) {
continue;
}
-
$name = trim($csv[0]);
$extref = trim($csv[1]);
$price_default = str_replace(",",".", trim($csv[4]));
@@ -113,6 +112,11 @@ class Voiceplan extends mfBaseModel {
$price_ek = $price_special;
}
+ $price_vk = 0;
+ if($price_ek && $this->price_multiplicator) {
+ $price_vk = (float)$price_ek * (float)$this->price_multiplicator;
+ }
+
if((!$name || !$price_ek) && $extref != "900") {
$this->log->warning(__METHOD__.": not importing Voiceplanzone with empty value: name: $name | ek: $price_ek");
continue;
@@ -123,7 +127,7 @@ class Voiceplan extends mfBaseModel {
"extref" => $extref,
"name" => $name,
"purchase_price" => $price_ek,
- "price" => 0,
+ "price" => $price_vk,
"increment_first" => $this->increment_first,
"increment" => $this->increment
]);
diff --git a/application/Voiceplan/VoiceplanController.php b/application/Voiceplan/VoiceplanController.php
index de655e976..81f5af4e4 100644
--- a/application/Voiceplan/VoiceplanController.php
+++ b/application/Voiceplan/VoiceplanController.php
@@ -124,6 +124,8 @@ class VoiceplanController extends mfBaseController {
$data = [];
$data['name'] = $r->name;
$data['description'] = $r->description;
+ $data['price_multiplicator'] = ($r->price_multiplicator) ? $r->price_multiplicator : 1;
+
if($r->increment) {
$increments = explode("/",$r->increment);
diff --git a/application/Voiceplan/VoiceplanModel.php b/application/Voiceplan/VoiceplanModel.php
index 77eb25aa5..6450f994e 100644
--- a/application/Voiceplan/VoiceplanModel.php
+++ b/application/Voiceplan/VoiceplanModel.php
@@ -7,6 +7,7 @@ class VoiceplanModel {
public $source_id;
public $increment_first;
public $increment;
+ public $price_multiplicator;
public $create_by;
public $edit_by;
diff --git a/db/migrations/20231205174410_voiceplan_add_price_multiplicator.php b/db/migrations/20231205174410_voiceplan_add_price_multiplicator.php
new file mode 100644
index 000000000..9c61bf092
--- /dev/null
+++ b/db/migrations/20231205174410_voiceplan_add_price_multiplicator.php
@@ -0,0 +1,31 @@
+getEnvironment() == "thetool") {
+ $table = $this->table("Voiceplan");
+ $table->addColumn("price_multiplicator", "decimal", ["null" => false, "default" => 1.000, "precision" => 8, "scale" => 4, "after" => "increment"]);
+ $table->update();
+ }
+
+ if($this->getEnvironment() == "addressdb") {
+
+ }
+ }
+
+ public function down(): void
+ {
+ if($this->getEnvironment() == "thetool") {
+ $this->table("Voiceplan")->removeColumn("price_multiplicator")->save();
+ }
+
+ if($this->getEnvironment() == "addressdb") {
+
+ }
+ }
+}
|