Files
OMS/app/ome/dbschema/dailystock.php
2025-12-28 23:13:25 +08:00

179 lines
5.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
$db['dailystock'] = [
'columns' => [
'id' => [
'type' => 'bigint unsigned',
'required' => true,
'pkey' => true,
'extra' => 'auto_increment',
'editable' => false,
],
'stock_date' => [
'type' => 'varchar(15)',
'required' => true,
'label' => '记录日期',
'default_in_list' => true,
'in_list' => true,
'order' => 1,
'filtertype' => 'normal',
'filterdefault' => true,
],
'branch_id' => [
'type' => 'int unsigned',
'label' => '仓库ID',
'required' => true,
'editable' => false,
],
'product_id' => [
'type' => 'int unsigned',
'label' => '商品ID',
'required' => true,
'editable' => false,
],
'product_bn' => [
'type' => 'varchar(200)',
'label' => '基础物料编码',
'width' => 150,
// 'searchtype' => 'has',
'filtertype' => 'textarea',
'filterdefault' => true,
'editable' => false,
'in_list' => true,
'default_in_list' => true,
'order' => 10,
'searchtype' => 'nequal',
],
'branch_bn' => [
'type' => 'varchar(30)',
'label' => '仓库编码',
'width' => 85,
// 'searchtype' => 'has',
// 'filtertype' => 'normal',
// 'filterdefault' => true,
'editable' => false,
'in_list' => true,
'default_in_list' => true,
'order' => 20,
'searchtype' => 'nequal',
],
'storage_code' => [
'type' => 'varchar(32)',
'in_list' => true,
'default_in_list' => true,
'label' => '仓内库位',
],
'stock_num' => [
'type' => 'int',
'label' => '期末库存',
'default' => 0,
'in_list' => true,
'default_in_list' => true,
'order' => 30,
],
'in_stock' => [
'type' => 'int',
'label' => '入库库存',
'default' => 0,
'in_list' => true,
'default_in_list' => true,
'order' => 40,
],
'out_stock' => [
'type' => 'int',
'label' => '出库库存',
'default' => 0,
'in_list' => true,
'default_in_list' => true,
'order' => 50,
],
'sale_stock' => [
'type' => 'int',
'label' => '销售库存',
'default' => 0,
'in_list' => true,
'default_in_list' => true,
'order' => 60,
],
'reship_stock' => [
'type' => 'int',
'label' => '销退库存',
'default' => 0,
'in_list' => true,
'default_in_list' => true,
'order' => 70,
],
'arrive_stock' => [
'type' => 'int',
'label' => '在途库存',
'default' => 0,
],
'freeze_stock' => [
'type' => 'int',
'label' => '冻结库存',
'default' => 0,
],
'unit_cost' => [
'type' => 'money',
'label' => '单位成本',
'default' => 0,
],
'inventory_cost' => [
'type' => 'money',
'label' => '库存成本',
'default' => 0,
],
'in_cost' => [
'type' => 'money',
'label' => '入库成本',
'default' => 0,
],
'out_cost' => [
'type' => 'money',
'label' => '出库成本',
'default' => 0,
],
'sale_cost' => [
'type' => 'money',
'label' => '销售成本',
'default' => 0,
],
'reship_cost' => [
'type' => 'money',
'label' => '销退成本',
'default' => 0,
],
'is_change' => [
'type' => 'tinyint(1)',
'label' => '较上次是否改变',
'default' => 0,
],
'at_time' => [
'type' => 'TIMESTAMP',
'label' => '创建时间',
'default' => 'CURRENT_TIMESTAMP',
],
'up_time' => [
'type' => 'TIMESTAMP',
'label' => '更新时间',
'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
],
],
'index' => [
'ind_product_id' => ['columns' => ['product_id']],
'ind_branch_id' => ['columns' => ['branch_id']],
'ind_date_bp' => ['columns' => ['stock_date', 'branch_id', 'product_id'], 'prefix' => 'unique'],
'ind_at_time' => ['columns' => ['at_time']],
'ind_up_time' => ['columns' => ['up_time']],
'ind_branch_bn' => ['columns' => ['branch_bn']],
'ind_product_bn' => ['columns' => ['product_bn']],
],
'engine' => 'innodb',
'version' => '$Rev: 40654 $',
'comment' => '每日库存快照',
];