]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
error_text
authorAlexander Smirnov <fredeom@mail.ru>
Wed, 18 Dec 2024 10:02:29 +0000 (13:02 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Wed, 18 Dec 2024 10:02:29 +0000 (13:02 +0300)
erp24/api2/controllers/DataController.php
erp24/migrations/m241218_094917_add_column_error_text_to_shift_transfer_waybill_incoming_waybill_write_offs.php [new file with mode: 0755]
erp24/records/ShiftTransfer.php
erp24/records/WaybillIncoming.php
erp24/records/WaybillWriteOffs.php

index c72aa2194541658bab6666a2dd3e021fb2fda614..b6f3ac9e805978548ed406e5b85b6b4dfcdc493a 100644 (file)
@@ -351,7 +351,7 @@ class DataController extends BaseController {
                     'date',
                     'comment',
                     'quantity',
-                    'summ'
+                    'summ_self_cost'
                 ])
                 ->indexBy('id')
                 ->andWhere(['status' => WriteOffsErp::STATUS_CONFIRM])
@@ -362,7 +362,7 @@ class DataController extends BaseController {
                 $waybillIncomingIds = array_column($waybillIncoming, 'id');
 
                 $products = WaybillIncomingProducts::find()
-                    ->select(['waybill_incoming_id', 'product_id', 'product_count', 'product_price', 'summ'])
+                    ->select(['waybill_incoming_id', 'product_id', 'product_count', 'product_self_cost', 'summ_self_cost'])
                     ->where(['in', 'waybill_incoming_id', $waybillIncomingIds])
                     ->asArray()
                     ->all();
@@ -373,7 +373,7 @@ class DataController extends BaseController {
                     $waybillIncomingProducts[$product['waybill_incoming_id']][] = [
                         'product_id' => $product['product_id'],
                         'quantity' => (string) $product['product_count'],
-                        'price' => $product['product_price'],
+                        'price' => $product['product_self_cost'],
                     ];
                 }
 
@@ -398,7 +398,7 @@ class DataController extends BaseController {
                         'type' => 'ревизия при передаче смены',
                         'cause' => 'Документ ревизии при передаче смены в ERP ' . $row['number'],
                         'items' => $row['items'],
-                        'summ' => $row['summ'],
+                        'summ' => $row['summ_self_cost'],
                         'comment' => $row['comment'],
                     ];
                 }
diff --git a/erp24/migrations/m241218_094917_add_column_error_text_to_shift_transfer_waybill_incoming_waybill_write_offs.php b/erp24/migrations/m241218_094917_add_column_error_text_to_shift_transfer_waybill_incoming_waybill_write_offs.php
new file mode 100755 (executable)
index 0000000..57fd433
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m241218_094917_add_column_error_text_to_shift_transfer_waybill_incoming_waybill_write_offs
+ */
+class m241218_094917_add_column_error_text_to_shift_transfer_waybill_incoming_waybill_write_offs extends Migration
+{
+    const TABLE_NAME = 'erp24.shift_transfer';
+    const TABLE_NAME2 = 'erp24.waybill_incoming';
+    const TABLE_NAME3 = 'erp24.waybill_write_offs';
+    const TABLE_NAME4 = 'erp24.replacement_invoice';
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeUp()
+    {
+        $this->addColumn(self::TABLE_NAME, 'error_text', $this->text()->null()->comment('Ошибка'));
+        $this->addColumn(self::TABLE_NAME2, 'error_text', $this->text()->null()->comment('Ошибка'));
+        $this->addColumn(self::TABLE_NAME3, 'error_text', $this->text()->null()->comment('Ошибка'));
+        $this->addColumn(self::TABLE_NAME4, 'error_text', $this->text()->null()->comment('Ошибка'));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeDown()
+    {
+        $this->dropColumn(self::TABLE_NAME4, 'error_text');
+        $this->dropColumn(self::TABLE_NAME3, 'error_text');
+        $this->dropColumn(self::TABLE_NAME2, 'error_text');
+        $this->dropColumn(self::TABLE_NAME, 'error_text');
+    }
+}
index 9a3eece75492e1a207b68cb5dd2a10fdd6f237ae..25839337e78e9aa912f42189516462b27dcb6429 100644 (file)
@@ -22,6 +22,8 @@ use Yii;
  * @property string|null $comment Комментарий принимающей стороны
  * @property string|null $report в формате HTML или TXT или JSON внешний вид всех данных при приеме
  * @property string|null $product_groups Список alias выбранных чекбоксов, через запятую
+ * @property string|null $error_text Ошибка
+ *
  */
 class ShiftTransfer extends \yii\db\ActiveRecord
 {
@@ -64,7 +66,7 @@ class ShiftTransfer extends \yii\db\ActiveRecord
             [['status_id', 'end_shift_admin_id', 'start_shift_admin_id'], 'integer'],
             [['date_start', 'date_end', 'groups1', 'groups2'], 'safe'],
             [['goods_transfer_summ', 'goods_transfer_count', 'discrepancy_pieces', 'discrepancy_rubles'], 'number'],
-            [['comment', 'report', 'product_groups'], 'string'],
+            [['comment', 'report', 'product_groups', 'error_text'], 'string'],
             [['date', 'store_guid'], 'string', 'max' => 36],
         ];
     }
@@ -91,7 +93,8 @@ class ShiftTransfer extends \yii\db\ActiveRecord
             'report' => 'Отчёт',
             'product_groups' => 'Продуктовые группы',
             'groups1' => 'Другие группы',
-            'groups2' => 'Основная группа'
+            'groups2' => 'Основная группа',
+            'error_text' => 'Error Text',
         ];
     }
 
index 665e7920346f760409b5945039ef671d00d8c4ca..2cf98097d4f6a088f5240cecf558b498437611d6 100644 (file)
@@ -29,6 +29,7 @@ use yii_app\helpers\DataHelper;
  * @property string $created_at Дата создания
  * @property string|null $updated_at Дата обновления
  * @property string|null $send_at Дата отправления в 1с
+ * @property string|null $error_text Ошибка
  */
 class WaybillIncoming extends \yii\db\ActiveRecord
 {
@@ -51,7 +52,7 @@ class WaybillIncoming extends \yii\db\ActiveRecord
             [['shift_transfer_id', 'status', 'created_admin_id', 'updated_admin_id', 'store_id', 'number'], 'default', 'value' => null],
             [['shift_transfer_id', 'status', 'created_admin_id', 'updated_admin_id', 'store_id'], 'integer'],
             [['date', 'created_at', 'updated_at', 'send_at'], 'safe'],
-            [['comment'], 'string'],
+            [['comment', 'error_text'], 'string'],
             [['quantity', 'summ', 'summ_self_cost'], 'number'],
             [['guid', 'store_guid', 'number', 'number_1c'], 'string', 'max' => 100],
             [['guid'], 'unique'],
@@ -101,6 +102,7 @@ class WaybillIncoming extends \yii\db\ActiveRecord
             'created_at' => 'Created At',
             'updated_at' => 'Updated At',
             'send_at' => 'Send At',
+            'error_text' => 'Error Text',
         ];
     }
 
index 3e80d56a73e57945397c3fc20a0372836092e0dc..3a198d1a445f67e276801270cab3dcbc486e8126 100644 (file)
@@ -30,6 +30,7 @@ use yii_app\helpers\DataHelper;
  * @property string $created_at Дата создания
  * @property string|null $updated_at Дата обновления
  * @property string|null $send_at Дата отправления в 1с
+ * @property string|null $error_text Ошибка
 
  * @property ShiftTransfer $shiftTransfer
  * @property WaybillWriteOffsProducts[] $waybillWriteOffsProducts
@@ -56,7 +57,7 @@ class WaybillWriteOffs extends \yii\db\ActiveRecord
             [['shift_transfer_id', 'status', 'created_admin_id', 'updated_admin_id', 'store_id'], 'default', 'value' => null],
             [['shift_transfer_id', 'status', 'created_admin_id', 'updated_admin_id', 'store_id'], 'integer'],
             [['date', 'created_at', 'updated_at', 'send_at'], 'safe'],
-            [['comment'], 'string'],
+            [['comment', 'error_text'], 'string'],
             [['quantity', 'summ', 'summ_self_cost'], 'number'],
             [['guid', 'store_guid', 'number', 'number_1c'], 'string', 'max' => 100],
             [['guid'], 'unique'],
@@ -105,6 +106,7 @@ class WaybillWriteOffs extends \yii\db\ActiveRecord
             'created_at' => 'Дата создания',
             'updated_at' => 'Дата обновления',
             'send_at' => 'Дата отправления в 1с',
+            'error_text' => 'Error Text',
         ];
     }