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

168 lines
4.0 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_items']=array (
'columns' =>
array (
'item_id' =>
array (
'type' => 'int unsigned',
'required' => true,
'pkey' => true,
'extra' => 'auto_increment',
),
'sale_id' =>
array (
'type' => 'table:sales@ome',
'required' => true,
'comment' => '销售单编号id',
),
'product_id' =>
array (
'type' => 'table:products@ome',
'required' => true,
'default' => 0,
'editable' => false,
'comment' => '货品ID',
),
'bn' =>
array (
'type' => 'varchar(40)',
'required' => true,
'filtertype' => 'normal',
'filterdefault' => true,
'default_in_list'=>true,
'in_list'=>true,
'label' => '货号',
'comment' => '货号',
),
'name'=>
array(
'type'=>'varchar(255)',
'default'=>'',
'comment' => '商品名称',
'label' => '商品名称',
),
'pmt_price' =>
array (
'type' => 'money',
'default' => '0',
'editable' => false,
'label' => '商品优惠价',
'comment' => '商品优惠价',
),
'orginal_price' =>
array (
'type' => 'money',
'default' => 0,
'label' => '商品原始价格',
'comment' => '商品原始价格',
),
'price' =>
array (
'type' => 'money',
'default' => 0,
'label' => '销售价格',
'comment' => '销售价格',
),
'spec_name' =>
array(
'type' => 'varchar(255)',
'default' => '',
'label' => '商品规格',
'comment' => '商品规格',
),
'nums' =>
array (
'type' => 'mediumint',
'required' => true,
'comment' => '销售数量',
),
'sales_amount' =>
array (
'type' => 'money',
'default' => '0',
'filterdefault' => true,
'default_in_list'=>true,
'in_list'=>true,
'label' => '销售额',
'comment' => '正销售:商品在订单实际成交金额;(原始金额-优惠金额-其他费用);负销售:退款金额',
'order' => '14'
),
'sale_price' =>
array (
'type' => 'money',
'default' => '0',
'label' => '订单明细货品销售价',
),
'apportion_pmt' =>
array (
'type' => 'money',
'default' => '0',
'label' => '平摊优惠金额',
),
'cost' =>
array (
'type' => 'money',
'default' => 0,
'comment' => '成本价格',
),
'cost_amount' =>
array (
'type' => 'money',
'default' => 0,
'label' => '成本金额',
'filterdefault' => true,
'default_in_list' => true,
'comment' => '数量*成本单价',
),
'gross_sales' =>
array (
'type' => 'money',
'default' => 0,
'label' => '销售毛利',
'comment' => '商品的销售毛利',
'in_list'=>true,
),
'gross_sales_rate' =>
array (
'type' => 'decimal(10,2)',
'default' => 0,
'label' => '毛利率',
'comment' => '商品的毛利率',
'in_list'=>true,
),
'cost_tax' =>
array (
'type' => 'money',
'comment' => '税率',
),
'branch_id' =>
array (
'type' => 'table:branch@ome',
'comment' => '仓库名称',
),
'iostock_id' =>
array (
'type' => 'table:iostock@ome',
'comment' => '出入库单号',
),
),
'comment' => '销售明细',
'engine' => 'innodb',
'version' => '$Rev: $',
);