Files
OMS/app/ome/dbschema/sales_objects.php
2026-01-04 19:08:31 +08:00

232 lines
7.3 KiB
PHP

<?php
/**
* Copyright 2012-2026 ShopeX (https://www.shopex.cn)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
$db['sales_objects'] = array(
'columns' => array(
'obj_id' => array(
'type' => 'int unsigned',
'required' => true,
'pkey' => true,
'extra' => 'auto_increment',
'order' => 1,
),
'sale_id' => array(
'type' => 'table:sales@ome',
'required' => true,
'in_list' => false,
'default_in_list' => false,
'label' => '销售单编号',
'comment' => '销售单编号id',
'order' => 2,
),
'order_id' => array(
'type' => 'table:orders@ome',
'required' => true,
'default' => '0',
'in_list' => false,
'default_in_list' => false,
'editable' => false,
'label' => '订单ID',
'order' => 3,
),
'order_obj_id' => array(
'type' => 'int unsigned',
'default' => 0,
'in_list' => false,
'default_in_list' => false,
'editable' => false,
'label' => '订单objects表ID',
'order' => 5,
),
'obj_type' => array(
'type' => 'varchar(50)',
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '物料类型',
'order' => 30,
),
'goods_id' => array(
'type' => 'int unsigned',
'required' => true,
'default' => 0,
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '销售物料ID',
'order' => 20,
),
'goods_bn' => array(
'type' => 'varchar(40)',
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '销售物料编号',
'order' => 22,
),
'goods_name' => array(
'type' => 'varchar(200)',
'editable' => false,
'label' => '销售物料名称',
'order' => 24,
),
'quantity' => array(
'type' => 'decimal(20,2)',
'default' => 1,
'required' => true,
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '销售数量',
'comment' => '销售数量',
'order' => 26,
),
'price' => array(
'type' => 'money',
'default' => 0,
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '销售单价',
'comment' => '销售单价',
'order' => 32,
),
'sale_price' => array(
'type' => 'money',
'default' => '0',
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '销售总价',
'comment' => '单价*销售数量',
'order' => 34,
),
'pmt_price' => array(
'type' => 'money',
'default' => '0',
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '商品优惠总金额',
'order' => 36,
),
'apportion_pmt' => array(
'type' => 'money',
'default' => '0',
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '平摊优惠金额',
'order' => 38,
),
'sales_amount' => array(
'type' => 'money',
'default' => '0',
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '总销售额',
'comment' => '正销售:商品在订单实际成交金额(原始总总金额-优惠金额-其他费用)',
'order' => 40,
),
'refund_money' => array(
'type' => 'money',
'default' => '0',
'in_list' => false,
'default_in_list' => false,
'editable' => false,
'label' => '退款金额',
'order' => 42,
),
'cost' => array(
'type' => 'money',
'default' => 0,
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '商品成本单价',
'comment' => '商品成本价格',
'order' => 44,
),
'cost_amount' => array(
'type' => 'money',
'default' => 0,
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'label' => '商品成本金额',
'comment' => '数量*成本单价',
'order' => 46,
),
'cost_tax' => array(
'type' => 'money',
'in_list' => true,
'default_in_list' => true,
'editable' => false,
'comment' => '商品开票税率',
'order' => 52,
),
'iostock_id' => array(
'type' => 'table:iostock@ome',
'label' => '出入库单号',
'in_list' => false,
'default_in_list' => false,
'editable' => false,
'comment' => '出入库单号',
'order' => 62,
),
'oid' => array(
'type' => 'varchar(50)',
'default' => 0,
'in_list' => false,
'default_in_list' => false,
'editable' => false,
'label' => '子订单号',
'order' => 70,
),
'settlement_amount' => array(
'type' => 'money',
'default' => '0',
'label' => '结算金额',//客户实付 + 平台支付总额
),
'actually_amount' => array(
'type' => 'money',
'default' => '0',
'label' => '客户实付',// 已支付金额 减去平台支付优惠,加平台支付总额
),
'platform_amount' => array(
'type' => 'money',
'default' => '0',
'label' => '平台承担金额(不包含支付优惠)',
),
'platform_pay_amount' => array(
'type' => 'money',
'default' => '0',
'label' => '支付优惠金额',
),
),
'index' => array(
'ind_goods_bn' => array(
'columns' => array('goods_bn'),
),
),
'comment' => '销售明细对象表',
'engine' => 'innodb',
'version' => '$Rev: $',
'charset' => 'utf8mb4',
);