From 076b13868ead0b83dad95ae1e40acff085a65e93 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Fri, 18 Jul 2025 09:24:05 +0300 Subject: [PATCH] [ERP-441] --- erp24/views/shift-transfer/update.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/erp24/views/shift-transfer/update.php b/erp24/views/shift-transfer/update.php index f49377ef..58a8721b 100644 --- a/erp24/views/shift-transfer/update.php +++ b/erp24/views/shift-transfer/update.php @@ -161,7 +161,25 @@ $this->registerJs('var getMeOut = false;', \yii\web\View::POS_HEAD, 'getMeOut') 'name' => 'remains_count', 'title' => 'Фактические остатки кол-во, шт', 'type' => BaseColumn::TYPE_TEXT_INPUT, - 'options' => ['min' => 0], + 'options' => function($data) { + $step = 1; + $isFloatValue = 0; + + if (!empty($data['remains_count'])) { + $arrayValue = explode('.',$data['remains_count']); + if (!empty($arrayValue[1])) { + $floatValue = floatval($arrayValue[1]); + if ($floatValue > 0) { + $isFloatValue = 1; + } + } + + if ($isFloatValue) { + $step = 0.01; + } + } + return ['type' => 'number', 'step' => $step, 'min' => 0]; + }, 'value' => function($data) { return $data['remains_count'] ?? ''; }, -- 2.39.5