]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-258] массовая загрузка групп
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 5 Dec 2024 11:58:12 +0000 (14:58 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 5 Dec 2024 11:58:12 +0000 (14:58 +0300)
erp24/controllers/ShiftTransferController.php
erp24/migrations/m241205_080132_alter_table_shift_transfer_product_groups.php [new file with mode: 0755]
erp24/records/ShiftTransfer.php
erp24/views/shift-transfer/update.php
erp24/web/js/shift-transfer/update.js

index 36362a9cee11847554476346b247f547cff6a255..68cfeca2ec3a06908abdfcc41c6f89f7fef2b0e9 100644 (file)
@@ -51,6 +51,39 @@ class ShiftTransferController extends Controller
         return $this->render('index', compact('shiftTransfers', 'storeNameById', 'admins'));
     }
 
+    public function buildLoadDataShiftRemains($groups, $storeGuid) {
+        $productsClass = ProductsClass::find()->select(['category_id'])->where(['tip' => $groups])->column();
+        $products = ArrayHelper::map(Products1c::find()->select(['id', 'name'])
+            ->where(['parent_id' => $productsClass])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name');
+        $balance = ArrayHelper::map(Balances::find()->select(['quantity', 'product_id'])
+            ->where(['store_id' => $storeGuid])->all(), 'product_id', 'quantity');
+        $productGuids = [];
+        foreach ($products as $key => $name) {
+            if (isset($balance[$key])) {
+                $productGuids[$key] = $name . ' (' . $balance[$key] . ' шт.)';
+            }
+            else {
+                $productGuids[$key] = $name;
+            }
+        }
+        $price = ArrayHelper::map(Prices::find()->select(['product_id', 'price'])->where(['product_id' => array_keys($products)])->all(), 'product_id', 'price');
+        $storeEIT = ExportImportTable::find()->select(['entity_id'])->where(['entity' => 'city_store', 'export_val' => $storeGuid, 'export_id' => 1])->one();
+        $selfCost = ArrayHelper::map(SelfCostProduct::find()->select(['product_guid', 'price'])->where(['product_guid' =>
+            array_keys($products), 'store_id' => $storeEIT->entity_id])->all(), 'product_guid', 'price');
+
+        $loadDataShiftRemains = [];
+        foreach ($productGuids as $key => $name) {
+            $loadDataShiftRemains[]= [
+                'product_guid' => $key, 'retail_price' => $price[$key] ?? '',
+                'self_cost' => $selfCost[$key] ?? '',
+                'remains_summ' => isset($price[$key]) && isset($balance[$key]) ? $price[$key] * $balance[$key]: '',
+                'remains_count' => $balance[$key] ?? '',
+                'fact_and_1c_diff' => 0, 'remains_1c' => $balance[$key] ?? ''
+            ];
+        }
+        return compact('loadDataShiftRemains', 'productGuids');
+    }
+
     public function actionCreate()
     {
         $shiftTransfer = new ShiftTransfer;
@@ -58,18 +91,30 @@ class ShiftTransferController extends Controller
         $shiftTransfer->date_start = $shiftTransfer->date;
         $shiftTransfer->status_id = ShiftTransfer::STATUS_ID_INPUT_FACT_REMAINS;
         $shiftTransfer->end_shift_admin_id = Yii::$app->user->id;
+        $shiftTransfer->groups2 = [ProductsClass::HINT_OTHER_ITEMS];
 
         $isCreate = true;
 
         $storeNameById = TaskService::getEntitiesByAlias('store');
         $storeGuids = AdminStores::find()->select(['store_guid'])->where(['admin_id' => Yii::$app->user->id])->column();
+        $firstId = null;
         foreach ($storeNameById as $id => $name) {
             if (!in_array($id, $storeGuids)) {
                 unset($storeNameById[$id]);
+                continue;
+            }
+            if (!$firstId) {
+                $firstId = $id;
             }
         }
 
-        return $this->render('update', compact('shiftTransfer', 'isCreate', 'storeNameById'));
+        $data = self::buildLoadDataShiftRemains($shiftTransfer->groups2, $firstId);
+        $loadDataShiftRemains = $data['loadDataShiftRemains'];
+        $productGuids = $data['productGuids'];
+
+        $shiftTransfer->shiftRemainsCopy = $loadDataShiftRemains ?? $shiftTransfer->shiftRemains;
+
+        return $this->render('update', compact('shiftTransfer', 'isCreate', 'storeNameById', 'productGuids'));
     }
 
     public function actionUpdate($id = null)
@@ -82,39 +127,48 @@ class ShiftTransferController extends Controller
         $loadDataShiftRemains = null;
         if ($shiftTransfer->load(Yii::$app->request->post())) {
             $postShiftTransfer = Yii::$app->request->post('ShiftTransfer');
-            $loadDataShiftRemains = ArrayHelper::getValue($postShiftTransfer, 'shiftRemainsCopy');
-
-            if ($shiftTransfer->id || ($shiftTransfer->validate() && $shiftTransfer->save())) {
-                ShiftRemains::deleteAll(['shift_transfer_id' => $shiftTransfer->id]);
-                $modelsShiftRemains = MultipleModel::createMultipleModel(ShiftRemains::class,
-                    'ShiftTransfer', 'shiftRemainsCopy');
-                if (!empty($loadDataShiftRemains)) {
-                    MultipleModel::loadMultipleFromArray($modelsShiftRemains, $loadDataShiftRemains, '', []);
-                }
+            $action = Yii::$app->request->post('action');
+            if ($action == 'applyGroups') {
+                $data = self::buildLoadDataShiftRemains(array_merge(empty($postShiftTransfer['groups1']) ? [] : $postShiftTransfer['groups1'],
+                    empty($postShiftTransfer['groups2']) ? [] : $postShiftTransfer['groups2']), $postShiftTransfer['store_guid']);
+                $loadDataShiftRemains = $data['loadDataShiftRemains'];
+                $productGuids = $data['productGuids'];
+            } else {
+                $loadDataShiftRemains = ArrayHelper::getValue($postShiftTransfer, 'shiftRemainsCopy');
+
+                if ($shiftTransfer->id || ($shiftTransfer->validate() && $shiftTransfer->save())) {
+                    ShiftRemains::deleteAll(['shift_transfer_id' => $shiftTransfer->id]);
+                    $modelsShiftRemains = MultipleModel::createMultipleModel(ShiftRemains::class,
+                        'ShiftTransfer', 'shiftRemainsCopy');
+                    if (!empty($loadDataShiftRemains)) {
+                        MultipleModel::loadMultipleFromArray($modelsShiftRemains, $loadDataShiftRemains, '', []);
+                    }
 
-                foreach ($modelsShiftRemains as $modelsShiftRemain) {
-                    $modelsShiftRemain->shift_transfer_id = $shiftTransfer->id;
-                    if ($modelsShiftRemain->validate()) {
-                        $modelsShiftRemain->save();
-                    } else {
-                        var_dump($modelsShiftRemain->getErrors());
-                        die;
+                    foreach ($modelsShiftRemains as $modelsShiftRemain) {
+                        $modelsShiftRemain->shift_transfer_id = $shiftTransfer->id;
+                        if ($modelsShiftRemain->validate()) {
+                            $modelsShiftRemain->save();
+                        } else {
+                            var_dump($modelsShiftRemain->getErrors());
+                            die;
+                        }
                     }
-                }
 
-                if ($shiftTransfer->validate()) {
-                    $shiftTransfer->goods_transfer_summ = array_sum(ArrayHelper::getColumn($shiftTransfer->shiftRemains, 'remains_summ'));
-                    $shiftTransfer->goods_transfer_count = array_sum(ArrayHelper::getColumn($shiftTransfer->shiftRemains, 'remains_count'));
-                    $shiftTransfer->discrepancy_pieces = array_sum(ArrayHelper::getColumn($shiftTransfer->shiftRemains, 'fact_and_1c_diff'));
-                    $shiftTransfer->discrepancy_rubles = array_sum(ArrayHelper::getColumn($shiftTransfer->shiftRemains, 'remains_1c'));
-                    $shiftTransfer->status_id = ShiftTransfer::STATUS_ID_TRANSFER_ACTIONS;
-                    $shiftTransfer->save();
+                    if ($shiftTransfer->validate()) {
+                        $shiftTransfer->goods_transfer_summ = array_sum(ArrayHelper::getColumn($shiftTransfer->shiftRemains, 'remains_summ'));
+                        $shiftTransfer->goods_transfer_count = array_sum(ArrayHelper::getColumn($shiftTransfer->shiftRemains, 'remains_count'));
+                        $shiftTransfer->discrepancy_pieces = array_sum(ArrayHelper::getColumn($shiftTransfer->shiftRemains, 'fact_and_1c_diff'));
+                        $shiftTransfer->discrepancy_rubles = array_sum(ArrayHelper::getColumn($shiftTransfer->shiftRemains, 'remains_1c'));
+                        $shiftTransfer->status_id = ShiftTransfer::STATUS_ID_TRANSFER_ACTIONS;
+                        $shiftTransfer->setProductGroups();
+                        $shiftTransfer->save();
 
-                    Yii::$app->session->setFlash('info', 'Документ передачи смены успешно сохранён. Сейчас документ находится в статусе Действия по замене.<br>' .
-                        'Для продолжения оформления документа в таблице возможных замен добавьте замену недостающего товара.');
+                        Yii::$app->session->setFlash('info', 'Документ передачи смены успешно сохранён. Сейчас документ находится в статусе Действия по замене.<br>' .
+                            'Для продолжения оформления документа в таблице возможных замен добавьте замену недостающего товара.');
 
-                    return $this->redirect(['/shift-transfer/view', 'id' => $shiftTransfer->id]);
-                 }
+                        return $this->redirect(['/shift-transfer/view', 'id' => $shiftTransfer->id]);
+                    }
+                }
             }
         }
 
@@ -130,7 +184,7 @@ class ShiftTransferController extends Controller
 
         $shiftTransfer->shiftRemainsCopy = $loadDataShiftRemains ?? $shiftTransfer->shiftRemains;
 
-        return $this->render('update', compact('shiftTransfer', 'isCreate', 'storeNameById'));
+        return $this->render('update', compact('shiftTransfer', 'isCreate', 'storeNameById', 'productGuids'));
     }
 
 
diff --git a/erp24/migrations/m241205_080132_alter_table_shift_transfer_product_groups.php b/erp24/migrations/m241205_080132_alter_table_shift_transfer_product_groups.php
new file mode 100755 (executable)
index 0000000..cfee66e
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m241205_080132_alter_table_shift_transfer_product_groups
+ */
+class m241205_080132_alter_table_shift_transfer_product_groups extends Migration
+{
+    const TABLE_NAME = 'erp24.shift_transfer';
+    /**
+     * {@inheritdoc}
+     */
+    public function safeUp()
+    {
+        $this->addColumn(self::TABLE_NAME, 'product_groups', $this->text()->null()->comment('Список alias выбранных чекбоксов, через запятую'));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeDown()
+    {
+        $this->dropColumn(self::TABLE_NAME, 'product_groups');
+    }
+}
index 05867dd4b6c98eeddff1971018f4acbbe5b4d48c..e46a5413725e25de8bab5d78b0d2970b50a910b4 100644 (file)
@@ -21,10 +21,13 @@ use Yii;
  * @property float|null $discrepancy_rubles Расхождение факта, руб.
  * @property string|null $comment Комментарий принимающей стороны
  * @property string|null $report в формате HTML или TXT или JSON внешний вид всех данных при приеме
+ * @property string|null $product_groups Список alias выбранных чекбоксов, через запятую
  */
 class ShiftTransfer extends \yii\db\ActiveRecord
 {
     public $shiftRemainsCopy;
+    public $groups1;
+    public $groups2;
 
     const STATUS_ID_INPUT_FACT_REMAINS = 1;
     const STATUS_ID_TRANSFER_ACTIONS = 2;
@@ -57,9 +60,9 @@ class ShiftTransfer extends \yii\db\ActiveRecord
             [['status_id', 'date', 'date_start', 'store_guid', 'end_shift_admin_id'], 'required'],
             [['status_id', 'end_shift_admin_id', 'start_shift_admin_id'], 'default', 'value' => null],
             [['status_id', 'end_shift_admin_id', 'start_shift_admin_id'], 'integer'],
-            [['date_start', 'date_end'], 'safe'],
+            [['date_start', 'date_end', 'groups1', 'groups2'], 'safe'],
             [['goods_transfer_summ', 'goods_transfer_count', 'discrepancy_pieces', 'discrepancy_rubles'], 'number'],
-            [['comment', 'report'], 'string'],
+            [['comment', 'report', 'product_groups'], 'string'],
             [['date', 'store_guid'], 'string', 'max' => 36],
         ];
     }
@@ -84,6 +87,9 @@ class ShiftTransfer extends \yii\db\ActiveRecord
             'discrepancy_rubles' => 'Расхождение факта, руб.',
             'comment' => 'Комментарий',
             'report' => 'Отчёт',
+            'product_groups' => 'Продуктовые группы',
+            'groups1' => 'Другая группа',
+            'groups2' => 'Основная группа'
         ];
     }
 
@@ -98,4 +104,15 @@ class ShiftTransfer extends \yii\db\ActiveRecord
     {
         return $this->hasMany(EqualizationRemains::class, ['shift_id' => 'id']);
     }
+
+    public function setGroups() {
+        function cb($a) { return $a != 'other_items'; }
+        function cb2($a) { return $a == 'other_items'; }
+        $this->groups1 = array_filter(explode(',', $this->product_groups ?? ''), 'cb');
+        $this->groups2 = array_filter(explode(',', $this->product_groups ?? ''), 'cb2');
+    }
+
+    public function setProductGroups() {
+        $this->product_groups = implode(',', array_merge(empty($this->groups1) ? [] : $this->groups1, empty($this->groups2) ? [] : $this->groups2));
+    }
 }
index a5b33e3dbefa38936cf697514005b6361592c6cf..3e85ea9944bca4bea16896c81853263875ca7b87 100644 (file)
@@ -16,6 +16,7 @@ use yii_app\records\ProductsClass;
 /* @var $isCreate bool */
 /* @var $shiftTransfer ShiftTransfer */
 /* @var $storeNameById array */
+/* @var $productGuids array */
 
 $this->registerJsFile('/js/shift-transfer/update.js', ['position' => \yii\web\View::POS_END]);
 
@@ -48,7 +49,9 @@ $this->registerCss('
 
     <div class="row">
         <div class="col-6">
-            <?= $form->field($shiftTransfer, 'store_guid')->dropDownList($storeNameById, ['onchange' => 'updateProductsWithBalanceAll();']) ?>
+            <?= $form->field($shiftTransfer, 'store_guid')->dropDownList($storeNameById, ['onchange'
+            => 'const inp = document.createElement("input"); inp.setAttribute("type", "hidden"); inp.setAttribute("name", "action");' .
+               ' inp.setAttribute("value", "applyGroups"); this.form.append(inp); this.form.submit();']) ?>
         </div>
     </div>
 
@@ -65,6 +68,23 @@ $this->registerCss('
         </div>
     </div>
 
+    <div class="row">
+        <details>
+            <summary>Другие</summary>
+            <div class="col-9">
+                <?php $hints1 = ProductsClass::getHints(); unset($hints1['other_items']); ?>
+                <?= $form->field($shiftTransfer, 'groups1')->checkboxList($hints1, ['checked' => 1]) ?>
+            </div>
+        </details>
+        <div class="col-9">
+            <?php $hints2 = [ProductsClass::HINT_OTHER_ITEMS => 'Номенклатура 1%'] ?>
+            <?= $form->field($shiftTransfer, 'groups2')->checkboxList($hints2, ['checked' => 1]) ?>
+        </div>
+        <div class="col-2 mt-5">
+            <?= Html::submitButton('Применить', ['class' => 'btn btn-success', 'name' => 'action', 'value' => 'applyGroups']) ?>
+        </div>
+    </div>
+
     <div class="row">
         <div class="col-12">
         <?= $form->field($shiftTransfer, 'shiftRemainsCopy')->widget(MultipleInput::class, [
@@ -76,8 +96,9 @@ $this->registerCss('
                     'title' => 'Продукт',
                     'type'  => Select2::class,
                     'options' => [
-                        'data' => ArrayHelper::map(Products1c::find()->select(['id', 'name'])
-                            ->where(['tip' => 'products'])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'),
+                        'data' => $productGuids,
+//                        ArrayHelper::map(Products1c::find()->select(['id', 'name'])
+//                            ->where(['tip' => 'products'])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'),
                     ],
                     'value' => function($data) {
                         return $data['product_guid'] ?? '';
@@ -86,7 +107,7 @@ $this->registerCss('
                         'style' => 'width: 70px;',
                     ]
                 ],
-                [
+                /*[
                     'name'  => 'group_label',
                     'title' => 'Название группы',
                     'type'  => Select2::class,
@@ -100,74 +121,74 @@ $this->registerCss('
                     'headerOptions' => [
                         'style' => 'width: 70px;',
                     ]
-                ],
+                ], */
                 [
-                    'name'  => 'retail_price',
-                    'title' => 'РозниÑ\87наÑ\8f Ñ\86ена, Ñ\80Ñ\83б',
+                    'name'  => 'remains_count',
+                    'title' => 'ФакÑ\82иÑ\87еÑ\81кие Ð¾Ñ\81Ñ\82аÑ\82ки ÐºÐ¾Ð»-во, Ñ\88Ñ\82',
                     'type'  => BaseColumn::TYPE_TEXT_INPUT,
-                    'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true],
+                    'options' => ['type' => 'number', 'step' => 1/*, 'min' => 0*/],
                     'value' => function($data) {
-                        return $data['retail_price'] ?? '';
+                        return $data['remains_count'] ?? '';
                     },
                     'headerOptions' => [
                         'style' => 'width: 70px;',
                     ]
                 ],
                 [
-                    'name'  => 'self_cost',
-                    'title' => 'СебеÑ\81Ñ\82оимоÑ\81Ñ\82Ñ\8c, Ñ\80Ñ\83б',
+                    'name'  => 'fact_and_1c_diff',
+                    'title' => 'РазниÑ\86а Ñ\84акÑ\82 Ð¸ Ð¿Ð¾ Ð¿Ñ\80огÑ\80амме 1Ñ\81, Ñ\88Ñ\82',
                     'type'  => BaseColumn::TYPE_TEXT_INPUT,
                     'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true],
                     'value' => function($data) {
-                        return $data['self_cost'] ?? '';
+                        return $data['fact_and_1c_diff'] ?? '';
                     },
                     'headerOptions' => [
                         'style' => 'width: 70px;',
                     ]
                 ],
                 [
-                    'name'  => 'remains_summ',
-                    'title' => 'СÑ\83мма Ð¾Ñ\81Ñ\82аÑ\82ков (недоÑ\81Ñ\82аÑ\87а Ð¸Ð»Ð¸ Ð¸Ð·Ð»Ð¸Ñ\88ек), Ñ\80Ñ\83б',
+                    'name'  => 'remains_1c',
+                    'title' => 'Ð\9eÑ\81Ñ\82аÑ\82ки Ð¿Ð¾ 1Ñ\81, Ñ\88Ñ\82',
                     'type'  => BaseColumn::TYPE_TEXT_INPUT,
                     'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true],
                     'value' => function($data) {
-                        return $data['remains_summ'] ?? '';
+                        return $data['remains_1c'] ?? '';
                     },
                     'headerOptions' => [
                         'style' => 'width: 70px;',
                     ]
                 ],
                 [
-                    'name'  => 'remains_count',
-                    'title' => 'ФакÑ\82иÑ\87еÑ\81кие Ð¾Ñ\81Ñ\82аÑ\82ки ÐºÐ¾Ð»-во, Ñ\88Ñ\82',
+                    'name'  => 'retail_price',
+                    'title' => 'РозниÑ\87наÑ\8f Ñ\86ена, Ñ\80Ñ\83б',
                     'type'  => BaseColumn::TYPE_TEXT_INPUT,
-                    'options' => ['type' => 'number', 'step' => 1, 'min' => 0],
+                    'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true],
                     'value' => function($data) {
-                        return $data['remains_count'] ?? '';
+                        return $data['retail_price'] ?? '';
                     },
                     'headerOptions' => [
                         'style' => 'width: 70px;',
                     ]
                 ],
                 [
-                    'name'  => 'fact_and_1c_diff',
-                    'title' => 'РазниÑ\86а Ñ\84акÑ\82 Ð¸ Ð¿Ð¾ Ð¿Ñ\80огÑ\80амме 1Ñ\81, Ñ\88Ñ\82',
+                    'name'  => 'self_cost',
+                    'title' => 'СебеÑ\81Ñ\82оимоÑ\81Ñ\82Ñ\8c, Ñ\80Ñ\83б',
                     'type'  => BaseColumn::TYPE_TEXT_INPUT,
                     'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true],
                     'value' => function($data) {
-                        return $data['fact_and_1c_diff'] ?? '';
+                        return $data['self_cost'] ?? '';
                     },
                     'headerOptions' => [
                         'style' => 'width: 70px;',
                     ]
                 ],
                 [
-                    'name'  => 'remains_1c',
-                    'title' => 'Ð\9eÑ\81Ñ\82аÑ\82ки Ð¿Ð¾ 1Ñ\81, Ñ\88Ñ\82',
+                    'name'  => 'remains_summ',
+                    'title' => 'СÑ\83мма Ð¾Ñ\81Ñ\82аÑ\82ков (недоÑ\81Ñ\82аÑ\87а Ð¸Ð»Ð¸ Ð¸Ð·Ð»Ð¸Ñ\88ек), Ñ\80Ñ\83б',
                     'type'  => BaseColumn::TYPE_TEXT_INPUT,
                     'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true],
                     'value' => function($data) {
-                        return $data['remains_1c'] ?? '';
+                        return $data['remains_summ'] ?? '';
                     },
                     'headerOptions' => [
                         'style' => 'width: 70px;',
index aea5b7e09674a7a8d715024324cfea7b39c8774b..ee787388db6c43ec4aef1a5ee84bbdbecc9a0122 100644 (file)
@@ -4,39 +4,39 @@
 const param24 = $('meta[name=csrf-param]').attr('content');
 const token24 = $('meta[name=csrf-token]').attr('content');
 
-function updateProductsWithBalance(currentIndex, row) {
-    const store = $('#shifttransfer-store_guid');
-    const productGuid = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-product_guid');
-    productGuid.empty();
-    $.ajax({
-        type: 'POST',
-        url: '/shift-transfer/get-products-with-remains',
-        data: { storeGuid: store.val(), [param24]: token24 },
-        dataType: 'json',
-        success: (data) => {
-            console.log(data);
-            $.each(data, (key, el) => {
-                console.log(key, el)
-                const opt = document.createElement('option');
-                opt.text = el;
-                opt.value = key;
-                productGuid.append(opt);
-            })
-        }
-    });
-}
+// function updateProductsWithBalance(currentIndex, row) {
+//     const store = $('#shifttransfer-store_guid');
+//     const productGuid = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-product_guid');
+//     productGuid.empty();
+//     $.ajax({
+//         type: 'POST',
+//         url: '/shift-transfer/get-products-with-remains',
+//         data: { storeGuid: store.val(), [param24]: token24 },
+//         dataType: 'json',
+//         success: (data) => {
+//             console.log(data);
+//             $.each(data, (key, el) => {
+//                 console.log(key, el)
+//                 const opt = document.createElement('option');
+//                 opt.text = el;
+//                 opt.value = key;
+//                 productGuid.append(opt);
+//             })
+//         }
+//     });
+// }
 
-function updateProductsWithBalanceAll() {
-    const rows = $('.multiple-input-list__item');
-    for (let currentIndex = 0; currentIndex < rows.length; currentIndex++) {
-        updateProductsWithBalance(currentIndex + 1, rows[currentIndex]);
-    }
-}
+// function updateProductsWithBalanceAll() {
+//     const rows = $('.multiple-input-list__item');
+//     for (let currentIndex = 0; currentIndex < rows.length; currentIndex++) {
+//         updateProductsWithBalance(currentIndex + 1, rows[currentIndex]);
+//     }
+// }
 
 function checkInputRow(currentIndex, row, errorContainer) {
     const productGuid = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-product_guid');
     const productName = $(row).find('#select2-shifttransfer-shiftremainscopy-' + currentIndex + '-product_guid-container').text();
-    const groupLabel = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-group_label');
+    //const groupLabel = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-group_label');
     const retailPrice = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-retail_price');
     const selfCost = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-self_cost');
     const remains1c = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-remains_1c');
@@ -49,7 +49,7 @@ function checkInputRow(currentIndex, row, errorContainer) {
     }
 
     return checkField(productGuid, currentIndex, productName, 'Не выбран продукт.', errorContainer) &&
-        checkField(groupLabel, currentIndex, productName, 'Пустое название группы.', errorContainer) &&
+        // checkField(groupLabel, currentIndex, productName, 'Пустое название группы.', errorContainer) &&
         checkField(retailPrice, currentIndex, productName, 'Не назначена розничная цена.', errorContainer) &&
         checkField(selfCost, currentIndex, productName, 'Отсутствует себестоимость.', errorContainer) &&
         checkField(remains1c, currentIndex, productName, 'Отсутствует информация об остатках в 1с.', errorContainer) &&
@@ -63,7 +63,7 @@ function checkInputs() {
     let noError = true;
     const errorContainer = [];
     for (let currentIndex = 0; currentIndex < rows.length; currentIndex++) {
-        noError = checkInputRow(currentIndex + 1, rows[currentIndex], errorContainer) && noError;
+        noError = checkInputRow(currentIndex, rows[currentIndex], errorContainer) && noError;
     }
     if (errorContainer.length > 0) {
         alert(errorContainer.join('\n'));
@@ -72,9 +72,9 @@ function checkInputs() {
 }
 
 function setMultipleInputHandlers(currentIndex, row) {
-    updateProductsWithBalance(currentIndex, row);
+    // updateProductsWithBalance(currentIndex, row);
     const store = $('#shifttransfer-store_guid');
-    const groupLabel = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-group_label');
+    // const groupLabel = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-group_label');
     const productGuid = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-product_guid');
     const retailPrice = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-retail_price');
     const selfCost = $(row).find('#shifttransfer-shiftremainscopy-' + currentIndex + '-self_cost');
@@ -95,7 +95,7 @@ function setMultipleInputHandlers(currentIndex, row) {
             data: { productGuid: e.target.value, storeGuid: store.val(), [param24]: token24 },
             dataType: 'json',
             success: (data) => {
-                if (data.groupLabel) { groupLabel.val(data.groupLabel); groupLabel.select2('destroy'); groupLabel.select2(); }
+                // if (data.groupLabel) { groupLabel.val(data.groupLabel); groupLabel.select2('destroy'); groupLabel.select2(); }
                 if (data.price) { retailPrice.val(data.price); }
                 if (data.selfCost) { selfCost.val(data.selfCost); }
                 if (data.quantity) { remains1c.val(data.quantity); }