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 */
'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 ? "%" : "") : " ";
},
],
],