diff --git a/Layout/default/Voiceplan/Form.php b/Layout/default/Voiceplan/Form.php index 357e3c506..73ec5feb3 100644 --- a/Layout/default/Voiceplan/Form.php +++ b/Layout/default/Voiceplan/Form.php @@ -44,12 +44,19 @@
- +
increment : ""?>" placeholder="60/30" />
+
+ +
+ +
+
+
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 @@ Anzahl Tarifzonen Anzahl Destinations Standardtaktung + Verkaufspreis Multiplikator Erstellt @@ -81,6 +82,7 @@ zones)?> destinations)?> increment_first && $plan->increment) ? $plan->increment_first."/".$plan->increment : ""?> + price_multiplicator)?>x create)?> (creator->name?>) $plan->id])?>"> diff --git a/Layout/default/Voiceplan/View.php b/Layout/default/Voiceplan/View.php index e2c90273c..5e9cb47cf 100644 --- a/Layout/default/Voiceplan/View.php +++ b/Layout/default/Voiceplan/View.php @@ -55,7 +55,7 @@ $zone->id])?>">name?> - destinations) > 1) ? count($zone->destinations) : "+".$zone->destinations[0]->prefix.""?> + destinations) > 1) ? count($zone->destinations)." Destinations" : "+".$zone->destinations[0]->prefix.""?> increment_first && $zone->increment) ? $zone->increment_first."/".$zone->increment : ""?> purchase_price?> price?> diff --git a/Layout/default/Voiceplanzone/View.php b/Layout/default/Voiceplanzone/View.php index 7547e3c8a..966c2d7ba 100644 --- a/Layout/default/Voiceplanzone/View.php +++ b/Layout/default/Voiceplanzone/View.php @@ -53,7 +53,7 @@ destination?> - prefix?> + +prefix?> create)?> (creator->name?>) edit)?> (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") { + + } + } +}