From f0b54b5c738e2774751e0f0fd5e270079b5271c3 Mon Sep 17 00:00:00 2001 From: marina Date: Tue, 3 Dec 2024 15:32:36 +0300 Subject: [PATCH] =?utf8?q?ERP-243=20=D0=94=D0=B5=D0=B9=D1=81=D1=82=D0=B2?= =?utf8?q?=D0=B8=D1=8F=20=D0=BF=D0=BE=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD?= =?utf8?q?=D0=B5=20(II=20=D1=8D=D1=82=D0=B0=D0=BF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/records/ReplacementInvoice.php | 5 +++++ erp24/views/replacement-invoice/view.php | 28 +++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/erp24/records/ReplacementInvoice.php b/erp24/records/ReplacementInvoice.php index 3c0ceb37..e088fd0e 100644 --- a/erp24/records/ReplacementInvoice.php +++ b/erp24/records/ReplacementInvoice.php @@ -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']); + } } diff --git a/erp24/views/replacement-invoice/view.php b/erp24/views/replacement-invoice/view.php index d339195b..c4993b41 100644 --- a/erp24/views/replacement-invoice/view.php +++ b/erp24/views/replacement-invoice/view.php @@ -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; -- 2.39.5