]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
фикс удаления
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 21 Apr 2026 08:36:43 +0000 (11:36 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 21 Apr 2026 08:36:43 +0000 (11:36 +0300)
erp24/controllers/SupplierController.php
erp24/records/ProductMapping.php
erp24/records/Supplier.php

index 3c9a529f9e8915d4bed60cfd0a0352bcee210d2f..db098bbb0da8199bcb26bc9fd5b5e25e247f903e 100644 (file)
@@ -144,7 +144,7 @@ class SupplierController extends BaseController
             return $this->asJson([
                 'success' => true,
                 'message' => sprintf(
-                    'Ð\9fоÑ\81Ñ\82авÑ\89ик "%s" Ð´ÐµÐ°ÐºÑ\82ивиÑ\80ован. Ð¡Ð²Ñ\8fзаннÑ\8bÑ\85 Ð·Ð°Ð¿Ð¸Ñ\81ей: Ð¼Ð°Ñ\80киÑ\80овки â\80\94 %d, Ð¼Ð°Ð¿Ð¿Ð¸Ð½Ð³Ð¸ â\80\94 %d.',
+                    'Ð\9fоÑ\81Ñ\82авÑ\89ик "%s" Ð´ÐµÐ°ÐºÑ\82ивиÑ\80ован. Ð\9cаÑ\80киÑ\80овки: %d, Ð¼Ð°Ð¿Ð¿Ð¸Ð½Ð³Ð¸: %d.',
                     $model->name,
                     $result['markings'],
                     $result['product_mappings']
index 1f7fc44e2ff909ffabd20d38ce5f2db460b6a271..7c3526e31356ef0bdd57b9850f2fd5af44849549 100644 (file)
@@ -23,6 +23,7 @@ use yii\db\Expression;
  * @property string|null $article
  * @property string|null $barcode
  * @property int $quant                   Кратность заказа (>=1)
+ * @property bool $is_active
  * @property int $created_by
  * @property int|null $updated_by
  * @property string $created_at
@@ -97,6 +98,8 @@ class ProductMapping extends ActiveRecord
             ],
             ['supplier_id', 'validatePartialUnique'],
             [['article', 'barcode', 'plantation_id'], 'default', 'value' => null],
+            ['is_active', 'boolean'],
+            ['is_active', 'default', 'value' => true],
             ['marking_ids', 'each', 'rule' => ['integer']],
             ['marking_ids', 'default', 'value' => []],
         ];
@@ -113,6 +116,7 @@ class ProductMapping extends ActiveRecord
             'article' => 'Артикул',
             'barcode' => 'Штрихкод',
             'quant' => 'Квант',
+            'is_active' => 'Статус',
             'marking_ids' => 'Маркировки',
         ];
     }
index 71cfb424ee15b8b16a7d4c99b4fbf32f47d931c5..73c7531bd137e2d19232775520905a022299907c 100644 (file)
@@ -167,13 +167,13 @@ class Supplier extends ActiveRecord
                 ->execute();
 
             $mappingsCount = (int)Yii::$app->db->createCommand()
-                ->update('{{%erp24.product_mappings}}', ['deleted_at' => new Expression('NOW()')], ['supplier_id' => $this->id, 'deleted_at' => null])
+                ->update('{{%erp24.product_mappings}}', ['is_active' => false], ['supplier_id' => $this->id, 'is_active' => true])
                 ->execute();
 
             $transaction->commit();
 
             return [
-                'markings' => $markingsCount,
+                'markings'        => $markingsCount,
                 'product_mappings' => $mappingsCount,
             ];
         } catch (\Exception $e) {