From 8717db1a4dc717996668ab0d0827b27d7129abc3 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 5 Dec 2023 19:54:10 +0100 Subject: [PATCH] Voiceplan Copy recalculates price based on new multiplicator --- Layout/default/Voiceplan/Form.php | 2 +- application/Voiceplan/VoiceplanController.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Layout/default/Voiceplan/Form.php b/Layout/default/Voiceplan/Form.php index 73ec5feb3..69ee2467f 100644 --- a/Layout/default/Voiceplan/Form.php +++ b/Layout/default/Voiceplan/Form.php @@ -51,7 +51,7 @@
- +
diff --git a/application/Voiceplan/VoiceplanController.php b/application/Voiceplan/VoiceplanController.php index 81f5af4e4..a1bc10666 100644 --- a/application/Voiceplan/VoiceplanController.php +++ b/application/Voiceplan/VoiceplanController.php @@ -171,6 +171,9 @@ class VoiceplanController extends mfBaseController { $new_zone->voiceplan_id = $id; $new_zone->increment_first = $voiceplan->increment_first; $new_zone->increment = $voiceplan->increment; + if($new_zone->purchase_price && $voiceplan->price_multiplicator) { + $new_zone->price = (float)$new_zone->purchase_price * (float)$voiceplan->price_multiplicator; + } if(!$new_zone->save()) { $this->layout()->setFlash("Fehler beim Kopieren der Source Zone!", "error"); $this->redirect("Voiceplan", "view", ["id" => $id]);