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

index 3c0ceb37250495282f3d4116275b4962cc34606d..e088fd0e7ad4455d776881477490e292ff0e6760 100644 (file)
@@ -141,4 +141,9 @@ class ReplacementInvoice extends \yii\db\ActiveRecord
     public function getCreatedAdmin() {
         return $this->hasOne(Admin::class, ['id' => 'created_admin_id']);
     }
+
+
+    public function getStore() {
+        return $this->hasOne(CityStore::class, ['id' => 'store_id']);
+    }
 }
index d339195b27ce0e7c98b8c4e8b5965fe5b1bdb05f..c4993b4102ba8197df0f637c6f79360478211944 100644 (file)
@@ -22,15 +22,33 @@ $this->params['breadcrumbs'][] = $this->title;
         'attributes' => [
             'id',
             'guid',
-            'status',
-            'store_id',
-            'store_guid',
+            [
+                'format' => 'raw',
+                'attribute' => 'status',
+                'value' => function ($model) {
+                    return $model->status == \yii_app\records\ReplacementInvoice::REPLACEMENT_ACTIONS ? 'Действия по замене' : $model->status;
+                }
+            ],
+            [
+                'format' => 'raw',
+                'attribute' => 'store_id',
+                'value' => function ($model) {
+                    return $model->store->name;
+                }
+            ],
             'number',
             'number_1c',
-            'date',
+            [
+                'attribute' => 'date',
+                'format' => 'datetime',
+            ],
             'comment',
-            'created_at::datetime',
             [
+                'attribute' => 'created_at',
+                'format' => 'datetime',
+            ],
+            [
+                'format' => 'raw',
                 'attribute' => 'created_admin_id',
                 'value' => function ($model) {
                     return $model->createdAdmin->name_full;