]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-441]
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Fri, 18 Jul 2025 06:24:05 +0000 (09:24 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Fri, 18 Jul 2025 06:24:05 +0000 (09:24 +0300)
erp24/views/shift-transfer/update.php

index f49377ef215c07e03f3d08361f80f6100802aeef..58a8721bcae04841ba78d34252805c1ca012f725 100644 (file)
@@ -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'] ?? '';
                     },