From: fomichev Date: Tue, 10 Dec 2024 11:52:23 +0000 (+0300) Subject: Генерация моделей X-Git-Tag: 1.7~179^2~4 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=917c74309a3b1323cec42470c475908614191ffa;p=erp24_rep%2Fyii-erp24%2F.git Генерация моделей --- diff --git a/erp24/records/WaybillWriteOffs.php b/erp24/records/WaybillWriteOffs.php new file mode 100644 index 00000000..3b67005b --- /dev/null +++ b/erp24/records/WaybillWriteOffs.php @@ -0,0 +1,116 @@ + null], + [['shift_transfer_id', 'status', 'created_admin_id', 'updated_admin_id', 'confirm_admin_id', 'store_id', 'active', 'deleted_admin_id'], 'integer'], + [['date', 'created_at', 'updated_at', 'deleted_at', 'send_at'], 'safe'], + [['comment'], 'string'], + [['quantity', 'summ', 'summ_self_cost'], 'number'], + [['guid', 'store_guid', 'number', 'number_1c', 'confirm_at'], 'string', 'max' => 100], + [['guid'], 'unique'], + [['shift_transfer_id'], 'exist', 'skipOnError' => true, 'targetClass' => ShiftTransfer::class, 'targetAttribute' => ['shift_transfer_id' => 'id']], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'guid' => 'GUID документа для 1c', + 'shift_transfer_id' => 'ID записи передачи смены', + 'status' => 'Статус документа', + 'created_admin_id' => 'Создан пользователем', + 'updated_admin_id' => 'Изменён пользователем', + 'confirm_admin_id' => 'Подтвержден пользователем', + 'store_id' => 'id магазина в ERP', + 'store_guid' => 'GUID магазина из 1с', + 'number' => 'Название документа', + 'number_1c' => 'Название документа в 1с', + 'date' => 'Дата документа', + 'comment' => 'Комментарий', + 'quantity' => 'Количество', + 'summ' => 'Сумма розничная', + 'summ_self_cost' => 'Сумма себестоимости', + 'created_at' => 'Дата создания', + 'updated_at' => 'Дата обновления', + 'deleted_at' => 'Дата удаление', + 'confirm_at' => 'Дата подтверждения', + 'send_at' => 'Дата отправления в 1с', + 'active' => 'Активность', + 'deleted_admin_id' => 'Удален пользователем', + ]; + } + + /** + * Gets query for [[ShiftTransfer]]. + * + * @return \yii\db\ActiveQuery + */ + public function getShiftTransfer() + { + return $this->hasOne(ShiftTransfer::class, ['id' => 'shift_transfer_id']); + } + + /** + * Gets query for [[WaybillWriteOffsProducts]]. + * + * @return \yii\db\ActiveQuery + */ + public function getWaybillWriteOffsProducts() + { + return $this->hasMany(WaybillWriteOffsProducts::class, ['waybill_write_offs_id' => 'id']); + } +} diff --git a/erp24/records/WaybillWriteOffsProducts.php b/erp24/records/WaybillWriteOffsProducts.php new file mode 100644 index 00000000..1b5762bd --- /dev/null +++ b/erp24/records/WaybillWriteOffsProducts.php @@ -0,0 +1,80 @@ + null], + [['waybill_write_offs_id'], 'integer'], + [['product_count', 'product_price', 'product_self_cost', 'summ', 'summ_self_cost'], 'number'], + [['created_at', 'updated_at'], 'safe'], + [['name'], 'string', 'max' => 100], + [['product_id'], 'string', 'max' => 255], + [['waybill_write_offs_id'], 'exist', 'skipOnError' => true, 'targetClass' => WaybillWriteOffs::class, 'targetAttribute' => ['waybill_write_offs_id' => 'id']], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'waybill_write_offs_id' => 'GUID документа из таблицы waybill_write_offs', + 'name' => 'Название товара', + 'product_id' => 'ID товара с недостатком', + 'product_count' => 'Количество товара с недостатком', + 'product_price' => 'Цена товара розничная', + 'product_self_cost' => 'Себестоимость товара', + 'summ' => 'Сумма розничная', + 'summ_self_cost' => 'Сумма себестоимости', + 'created_at' => 'Дата создания', + 'updated_at' => 'Дата обновления', + ]; + } + + /** + * Gets query for [[WaybillWriteOffs]]. + * + * @return \yii\db\ActiveQuery + */ + public function getWaybillWriteOffs() + { + return $this->hasOne(WaybillWriteOffs::class, ['id' => 'waybill_write_offs_id']); + } +}