From 4c8dd1ade341c7abf990f9cd2d4cf95fa6012567 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Wed, 14 Aug 2024 17:20:49 +0300 Subject: [PATCH] =?utf8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?utf8?q?=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=20?= =?utf8?q?=D0=BD=D0=B0=20=D1=82=D0=B8=D0=BF=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MotivationService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index eba9efdd..67f58551 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -549,7 +549,8 @@ class MotivationService if ($mv) { switch ($mv->value_type) { case MotivationCostsItem::DATA_TYPE_INT: { $sum += $mv->value_int; break; } - default: { $sum += $mv->value_float; $sum_type = MotivationCostsItem::DATA_TYPE_FLOAT; break; } + case MotivationCostsItem::DATA_TYPE_FLOAT: { $sum += $mv->value_float; $sum_type = MotivationCostsItem::DATA_TYPE_FLOAT; break; } + case MotivationCostsItem::DATA_TYPE_STRING: { throw new \Exception(Json::encode("Тип string невозможен для вычисления прогноза")); } }; } } -- 2.39.5