]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-243 Действия по замене (II этап)
authormarina <m.zozirova@gmail.com>
Wed, 27 Nov 2024 08:06:06 +0000 (11:06 +0300)
committermarina <m.zozirova@gmail.com>
Wed, 27 Nov 2024 08:06:06 +0000 (11:06 +0300)
erp24/migrations/m241126_064206_add_new_column_on_shift_remains.php [new file with mode: 0644]
erp24/migrations/m241127_065457_create_equalization_remains_table.php [new file with mode: 0644]

diff --git a/erp24/migrations/m241126_064206_add_new_column_on_shift_remains.php b/erp24/migrations/m241126_064206_add_new_column_on_shift_remains.php
new file mode 100644 (file)
index 0000000..b29a362
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+use yii\db\Migration;
+
+class m241126_064206_add_new_column_on_shift_remains extends Migration
+{
+    public function safeUp()
+    {
+        $this->addColumn('shift_remains', 'type', $this->integer()->notNull()->defaultValue(1)->comment('Тип записи'));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeDown()
+    {
+        $this->dropColumn('shift_remains', 'type');
+    }
+}
diff --git a/erp24/migrations/m241127_065457_create_equalization_remains_table.php b/erp24/migrations/m241127_065457_create_equalization_remains_table.php
new file mode 100644 (file)
index 0000000..4eb9935
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m241127_065457_create_equalization_remains_table
+ */
+class m241127_065457_create_equalization_remains_table extends Migration
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function safeUp()
+    {
+        $this->createTable('erp24.equalization_remains', [
+            'id' => $this->primaryKey()->comment('ID записи'),
+            'shift_id' => $this->integer()->comment('ID записи передачи смены'),
+            'product_id' => $this->string()->comment('ID товара с недостатком'),
+            'product_count' => $this->float()->comment('Количество товара с недостатком'),
+            'product_price' => $this->float()->comment('Цена товара розничная'),
+            'product_price_seft_cost' => $this->float()->comment('Себестоимость товара'),
+            'product_replacement_id' => $this->string()->comment('Товар замена'),
+            'product_replacement_count' => $this->float()->comment('Количество товара замены'),
+            'product_replacement_price' => $this->float()->comment('Цена товара замены розничная'),
+            'product_replacement_price_seft_cost' => $this->float()->comment('Себестоимость товара замены'),
+            'balance' => $this->float()->comment('Разница в сумме'),
+            'created_at' => $this->dateTime()->comment('Дата создания записи'),
+            'updated_at' => $this->dateTime()->comment('Дата обновления записи'),
+            'created_by' => $this->integer()->comment('Автор создания записи'),
+            'updated_by' => $this->integer()->comment('Автор обновления записи'),
+        ]);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeDown()
+    {
+        $this->dropTable('equalization_remains');
+    }
+}