]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-243 Действия по замене (II этап)
authormarina <m.zozirova@gmail.com>
Tue, 3 Dec 2024 14:15:27 +0000 (17:15 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 3 Dec 2024 14:15:27 +0000 (17:15 +0300)
erp24/records/ReplacementInvoice.php
erp24/views/replacement-invoice/index.php
erp24/views/store-balance/view.php

index 556ef76f93a08ab410901fd28ecfd98f9c47c576..d8d9db66f4476323c5a66403b16692ad36c99ac8 100644 (file)
@@ -97,9 +97,7 @@ class ReplacementInvoice extends \yii\db\ActiveRecord
 
         if ($model->validate()) {
             $model->save();
-            $model->update([
-                'number' => 'ЕРП_ПС_' . date("Y-m-d_H-i") . $model->id,
-            ]);
+            $model->updateAttributes(['number' => 'ЕРП_ПС_' . date("Y-m-d_H-i") . $model->id]);
             ReplacementInvoiceProducts::setData($model, $shiftTransfer);
         } else {
             var_dump($model->getErrors());
index 4cc0d771765d0102f64da65d6feaf4ca14968709..b5d0ee9965aa58c15a05618d627efe79a7168c38 100644 (file)
@@ -2,6 +2,7 @@
 
 use yii\helpers\Html;
 use yii\grid\GridView;
+use yii_app\records\CityStore;
 
 /* @var $this yii\web\View */
 /* @var $dataProvider yii\data\ActiveDataProvider */
@@ -17,15 +18,29 @@ $this->params['breadcrumbs'][] = $this->title;
         'dataProvider' => $dataProvider,
         'columns' => [
             ['class' => 'yii\grid\SerialColumn'],
-
-            'id',
-            'guid',
-            'store_id',
+            [
+                'attribute' => 'guid',
+                'value' => function ($model) {
+                    return \yii\helpers\Html::a($model->guid, ['view', 'id' => $model->id]);
+                },
+                'format' => 'raw',
+            ],
+            [
+                'attribute' => 'store_id',
+                'value' => function ($model) {
+                    return CityStore::findOne(\yii_app\records\ExportImportTable::findOne(['export_val' => $model->store_guid])->entity_id)->name;
+                }
+            ],
             'number',
             'date',
-            'status',
-            'active',
             'created_at',
+                        [
+                'attribute' => 'created_admin_id',
+                'value' => function ($model) {
+                    return $model->createdAdmin->name_full;
+                }
+            ],
+
             [
                 'class' => 'yii\grid\ActionColumn',
                 'template' => '{view}', // кнопка просмотра
index ec596729d1c45dbfd9500309fefb28fcfe1baf2e..8c2e85ac98bce1a8f0a744a226c13d3d767d6f62 100644 (file)
@@ -25,17 +25,15 @@ $this->params['breadcrumbs'][] = $this->title;
             [
                 'attribute' => 'store_id',
                 'value' => function ($model) {
-                    // Для отображения магазина с учетом связанной таблицы
                     return CityStore::findOne(\yii_app\records\ExportImportTable::findOne(['export_val' => $model->store_id])->entity_id)->name;
                 }
             ],
             [
                 'attribute' => 'shift_id',
                 'value' => function ($model) {
-                    // Если требуется вывести ссылку на смену
                     return Html::a("Передача смены #$model->shift_id", ['shift-transfer/view', 'id' => $model->shift_id]);
                 },
-                'format' => 'raw', // Позволяет выводить HTML, то есть ссылку
+                'format' => 'raw',
             ],
             'date',
             'amount',