From: marina Date: Tue, 3 Dec 2024 12:32:36 +0000 (+0300) Subject: ERP-243 Действия по замене (II этап) X-Git-Tag: 1.7~200^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=f0b54b5c738e2774751e0f0fd5e270079b5271c3;p=erp24_rep%2Fyii-erp24%2F.git ERP-243 Действия по замене (II этап) --- 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;