]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Правки по полям в документе списания
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 19 Dec 2024 07:24:16 +0000 (10:24 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 19 Dec 2024 07:24:16 +0000 (10:24 +0300)
erp24/records/WriteOffsErp.php
erp24/views/waybill-write-offs/index.php
erp24/views/waybill-write-offs/view.php

index 02f090ba023130e0e8f1fae5aa70b350a064e4eb..77b135ac88ac6a2b9c65cfb1f82ac26a7540ffb6 100644 (file)
@@ -123,6 +123,15 @@ class WriteOffsErp extends \yii\db\ActiveRecord
     const WRITE_OFFS_TYPE_DUE_TO_EQUIPMENT_FAILURE_BRAK = 'Брак из-за поломки оборудования';
     const WRITE_OFFS_TYPE_RESORTING_DOES_NOT_COUNT_TOWARDS_COST = 'Пересорт, не идет в затраты';
 
+    const STATUSES = [
+        self::STATUS_CREATED => "Создан",
+        self::STATUS_CONFIRM => "Одобрен",
+        self::STATUS_SEND => "Отправлен в 1С",
+        self::STATUS_CREATED_1С => "Создан в 1С",
+        self::STATUS_DISABLE => "Отклонен",
+        self::STATUS_ERROR_1С => "Ошибка в 1С",
+    ];
+
     public function custom_function_validation($attribute, $params)
     {
         if(!in_array($this->$attribute, $params['values'])) {
index 845ed78d44f59342c73f1c23bae48905c24d427b..0aaea0526c38d30022a420b2af149abdf574095b 100644 (file)
@@ -44,7 +44,13 @@ $this->params['breadcrumbs'][] = $this->title;
             'quantity',
             'summ',
             'summ_self_cost',
-
+            [
+                'label' => 'Статус',
+                'attribute' => 'status',
+                'value' => function ($model) {
+                    return \yii_app\records\WriteOffsErp::STATUSES[$model->status];
+                }
+            ],
             'created_at',
             'send_at',
             [
index e4a98c0432ed1473db6712f38b14ec1a78b7ab8b..790c049948add2401706fee89320efa9c0775901 100644 (file)
@@ -15,7 +15,7 @@ $this->params['breadcrumbs'][] = ['label' => 'Список документов'
 $this->params['breadcrumbs'][] = $this->title;
 ?>
 <div class="waybill-write-offs-view p-4">
-
+    <?= Html::a('Назад', ['index'], ['class' => 'btn btn-primary my-4']) ?>
     <h1><?= Html::encode($this->title) ?></h1>
 
     <!-- Детали документа -->
@@ -37,7 +37,29 @@ $this->params['breadcrumbs'][] = $this->title;
             'quantity',
             'summ',
             'summ_self_cost',
-            'status',
+            [
+                'label' => 'Статус',
+                'attribute' => 'status',
+                'value' => function ($model) {
+                    return \yii_app\records\WriteOffsErp::STATUSES[$model->status];
+                }
+            ],
+            [
+                'label' => 'Текст ошибки',
+                'attribute' => 'error_text',
+                'value' => function ($model) {
+                    return $model->status == 8 ? $model->error_text : 'Нет ошибки';
+                }
+            ],
+            [
+                'label' => 'Номер документа в 1С',
+                'attribute' => 'number_1c',
+                'value' => function ($model) {
+                    return
+                        $model->status == \yii_app\records\WriteOffsErp::STATUS_CREATED_1С ?
+                            $model->number_1c : 'Документ не создан';
+                }
+            ],
             [
                 'label' => 'Создан пользователем',
                 'attribute' => 'created_admin_id',
@@ -45,6 +67,7 @@ $this->params['breadcrumbs'][] = $this->title;
                     return Admin::findOne([$model->created_admin_id])->name;
                 }
             ],
+
             'created_at',
             'updated_at',
         ],