--- /dev/null
+<?php
+
+namespace app\controllers;
+
+use yii\data\ActiveDataProvider;
+use yii_app\records\WaybillWriteOffs;
+
+class WaybillWriteOffsController extends \yii\web\Controller
+{
+ public function actionIndex()
+ {
+ $dataProvider = new ActiveDataProvider([
+ 'query' => WaybillWriteOffs::find()->where(['active' => 1]), // Отображаем только активные записи
+ 'pagination' => [
+ 'pageSize' => 20, // Количество записей на странице
+ ],
+ ]);
+
+ return $this->render('index', [
+ 'dataProvider' => $dataProvider,
+ ]);
+ }
+
+ public function actionView()
+ {
+ return $this->render('view');
+ }
+
+}
--- /dev/null
+<?php
+
+use yii\grid\GridView;
+use yii\helpers\Html;
+use yii_app\records\Admin;
+use yii_app\records\CityStore;
+
+/** @var yii\data\ActiveDataProvider $dataProvider */
+
+$this->title = 'Список накладных списания';
+$this->params['breadcrumbs'][] = $this->title;
+?>
+<div class="waybill-write-offs-index p-4">
+
+ <h1><?= Html::encode($this->title) ?></h1>
+
+
+
+ <?= GridView::widget([
+ 'dataProvider' => $dataProvider,
+ 'columns' => [
+ ['class' => 'yii\grid\SerialColumn'],
+
+ 'id',
+ [
+ 'attribute' => 'guid',
+ 'value' => function ($model) {
+ return \yii\helpers\Html::a($model->guid, ['view', 'id' => $model->id]);
+ },
+ 'format' => 'raw',
+ ],
+ 'shift_transfer_id',
+ 'number',
+ 'date',
+ [
+ 'label' => 'Магазин',
+ 'attribute' => 'store_id',
+ 'value' => function ($model) {
+ return CityStore::findOne(\yii_app\records\ExportImportTable::findOne(['export_val' => $model->store_guid])->entity_id)->name;
+ }
+ ],
+ 'quantity',
+ 'summ',
+ 'summ_self_cost',
+
+ 'created_at',
+ 'send_at',
+ [
+ 'label' => 'Создан пользователем',
+ 'attribute' => 'created_admin_id',
+ 'value' => function ($model) {
+ return Admin::findOne( [$model->created_admin_id])->name;
+ }
+ ],
+ [
+ 'class' => 'yii\grid\ActionColumn',
+ 'template' => '{view} ',
+ ],
+ ],
+ ]); ?>
+
+</div>
\ No newline at end of file