From e15485c836b04d576ad3106a27cc1eb3d9027e8e Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Wed, 4 Sep 2024 18:52:05 +0300 Subject: [PATCH] =?utf8?q?[ERP-140]=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D0=BD?= =?utf8?q?=D1=82=D1=8B=20=D0=B2=20=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8=20?= =?utf8?q?=D1=87=D0=B8=D1=81=D0=BB=D0=B0=20=D0=B2=D0=B0=D0=B6=D0=BD=D1=8B?= =?utf8?q?=20=D0=BA=D0=B0=D0=BA=20=D0=B8=20=D1=83=D0=BC=D0=BD=D0=BE=D0=B6?= =?utf8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B0=20100=20=D0=BF=D1=80?= =?utf8?q?=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=D0=B5=20?= =?utf8?q?=D0=B2=20=D0=BD=D0=B8=D1=85=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/views/motivation/index.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/erp24/views/motivation/index.php b/erp24/views/motivation/index.php index 9e375ad0..99c18583 100644 --- a/erp24/views/motivation/index.php +++ b/erp24/views/motivation/index.php @@ -2,14 +2,13 @@ use \yii\helpers\Html; use kartik\select2\Select2; -use yii\helpers\Json; use yii\widgets\ActiveForm; use yii\base\DynamicModel; use kartik\grid\GridView; use yii_app\helpers\FormatHelper; use yii_app\records\Admin; use yii_app\records\Motivation; -use yii_app\records\MotivationCostsItem; +use yii_app\services\MotivationService; /** @var $model DynamicModel */ /** @var $stores array */ @@ -308,8 +307,12 @@ $this->registerJsFile('/js/motivation/index.js', ['position' => \yii\web\View::P 'attribute' => 'plan', 'header' => 'Значение', 'value' => function ($model) { - return $model["plan"] !== null ? FormatHelper::asDecimalMotivation($model["plan"]) : " "; - + $koef = in_array(intval($model['code']), [ + MotivationService::CODE_AGENT_SERVICES_TARIFF, + MotivationService::CODE_BONUS_SIZE, + MotivationService::CODE_THRESHOLD_COEFFICIENT + ]) ? 100 : 1; + return $model["plan"] !== null ? FormatHelper::asDecimalMotivation($model["plan"] * $koef) . ($koef == 100 ? "%" : "") : " "; }, ], ], -- 2.39.5