From 43d0b2d8f86388a4c6a21ebad05f100745c83ec5 Mon Sep 17 00:00:00 2001 From: marina Date: Tue, 3 Dec 2024 17:15:27 +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 | 4 +--- erp24/views/replacement-invoice/index.php | 27 ++++++++++++++++++----- erp24/views/store-balance/view.php | 4 +--- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/erp24/records/ReplacementInvoice.php b/erp24/records/ReplacementInvoice.php index 556ef76f..d8d9db66 100644 --- a/erp24/records/ReplacementInvoice.php +++ b/erp24/records/ReplacementInvoice.php @@ -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()); diff --git a/erp24/views/replacement-invoice/index.php b/erp24/views/replacement-invoice/index.php index 4cc0d771..b5d0ee99 100644 --- a/erp24/views/replacement-invoice/index.php +++ b/erp24/views/replacement-invoice/index.php @@ -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}', // кнопка просмотра diff --git a/erp24/views/store-balance/view.php b/erp24/views/store-balance/view.php index ec596729..8c2e85ac 100644 --- a/erp24/views/store-balance/view.php +++ b/erp24/views/store-balance/view.php @@ -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', -- 2.39.5