From: fomichev Date: Thu, 19 Dec 2024 07:24:16 +0000 (+0300) Subject: Правки по полям в документе списания X-Git-Tag: 1.7~139^2~1 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=acb3e996c6cd3884b4fe2e613fd6713973666cd9;p=erp24_rep%2Fyii-erp24%2F.git Правки по полям в документе списания --- diff --git a/erp24/records/WriteOffsErp.php b/erp24/records/WriteOffsErp.php index 02f090ba..77b135ac 100644 --- a/erp24/records/WriteOffsErp.php +++ b/erp24/records/WriteOffsErp.php @@ -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'])) { diff --git a/erp24/views/waybill-write-offs/index.php b/erp24/views/waybill-write-offs/index.php index 845ed78d..0aaea052 100644 --- a/erp24/views/waybill-write-offs/index.php +++ b/erp24/views/waybill-write-offs/index.php @@ -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', [ diff --git a/erp24/views/waybill-write-offs/view.php b/erp24/views/waybill-write-offs/view.php index e4a98c04..790c0499 100644 --- a/erp24/views/waybill-write-offs/view.php +++ b/erp24/views/waybill-write-offs/view.php @@ -15,7 +15,7 @@ $this->params['breadcrumbs'][] = ['label' => 'Список документов' $this->params['breadcrumbs'][] = $this->title; ?>
- + 'btn btn-primary my-4']) ?>

title) ?>

@@ -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', ],