SCO供应链协同

## 数据表：T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)

### T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)：描述

名称 | T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)
代码 | T_SPM_PROMOTIONPOLICYENTRY
注释 | 促销政策分录
模型 | SCO供应链协同
主键 | PK_SPM_PROMOTIONPOLICYENTRY

### T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
分销内码ID | FENTRYID | int |  | TRUE |
单据ID | FID | int |  | TRUE |
分录序号 | FSEQ | int |  | TRUE |
组合方式 | FCOMPOUNDMODE | varchar(20) | 20 | TRUE |
组号 | FGROUPNUMBER | int |  | TRUE |
计量单位 | FUNITID | int |  | TRUE |
赠品 | FPRESENTTYPE | varchar(20) | 20 | TRUE |
购买数量 | FPURCHASEQTY | decimal(23,10) | 23 | TRUE |
购买金额 | FPURCHASEAMOUNT | decimal(23,10) | 23 | TRUE |
赠送数量 | FENTRYPRESENTQTY | decimal(23,10) | 23 | TRUE |
促销价格 | FPROMOTIONPRICE | decimal(23,10) | 23 | TRUE |
折扣方式 | FDISCOUNTTYPE | varchar(20) | 20 | TRUE |
折扣率 | FDISCOUNTRATE | decimal(23,10) | 23 | TRUE |
折扣额 | FDISCOUNTAMOUNT | decimal(23,10) | 23 | TRUE |
备注 | FREMARK | nvarchar(255) | 255 | TRUE |
购买基本计量单位数量 | FBASEPURCHASEQTY | decimal(23,10) | 23 | TRUE |
赠送基本计量单位数量 | FBASEPRESENTQTY | decimal(23,10) | 23 | TRUE |
基本计量单位 | FBASEUNITID | int |  | TRUE |
物料分类 | FMATERIALGROUPID | int |  | TRUE |
物料 | FMATERIALID | int |  | TRUE |
物料内码ID | FMASTERID | int |  | TRUE |
辅助属性 | FASSISTPROPERTYID | int |  | TRUE |
整单折扣率 | FBILLDISCOUNTRATE | decimal(23,10) | 23 | TRUE |
整单折扣额 | FBILLDISCOUNTAMOUNT | decimal(23,10) | 23 | TRUE |
赠品赠送基数 | FPRESENTCYCLEQTY | decimal(23,10) | 23 | TRUE |
品种数量 | FENTRYPRESENTLIMITQTY | int |  | TRUE |
赠送品种数量限制 | FENTRYPRESENTLIMIT | varchar(20) | 20 | TRUE |

### T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)：脚本代码

if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('T_SPM_PROMOTIONPOLICYENTRY') and o.name = 'FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONPOLICYENTRY
drop constraint FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONPOLICYENTRY')
and name = 'IDX_SPM_PROMOPOLICY_MUGI'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONPOLICYENTRY.IDX_SPM_PROMOPOLICY_MUGI
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONPOLICYENTRY')
and name = 'IDX_SPM_PROMOPOLICY_MGF'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONPOLICYENTRY.IDX_SPM_PROMOPOLICY_MGF
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONPOLICYENTRY')
and name = 'IDX_SPM_PROMOPOLICY_MF'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONPOLICYENTRY.IDX_SPM_PROMOPOLICY_MF
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONPOLICYENTRY')
and name = 'IDX_SPM_PROMOPOLICY_FID'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONPOLICYENTRY.IDX_SPM_PROMOPOLICY_FID
go
if exists (select 1
from sysobjects
where id = object_id('T_SPM_PROMOTIONPOLICYENTRY')
and type = 'U')
drop table T_SPM_PROMOTIONPOLICYENTRY
go
/*==============================================================*/
/* Table: T_SPM_PROMOTIONPOLICYENTRY */
/*==============================================================*/
create table T_SPM_PROMOTIONPOLICYENTRY (
FENTRYID int not null default 0,
FID int not null default 0,
FSEQ int not null default 0,
FCOMPOUNDMODE varchar(20) not null default '1',
FGROUPNUMBER int not null default 0,
FUNITID int not null default 0,
FPRESENTTYPE varchar(20) not null default '',
FPURCHASEQTY decimal(23,10) not null default 0.0,
FPURCHASEAMOUNT decimal(23,10) not null default 0.0,
FENTRYPRESENTQTY decimal(23,10) not null default 0.0,
FPROMOTIONPRICE decimal(23,10) not null default 0.0,
FDISCOUNTTYPE varchar(20) not null default '',
FDISCOUNTRATE decimal(23,10) not null default 0.0,
FDISCOUNTAMOUNT decimal(23,10) not null default 0.0,
FREMARK nvarchar(255) not null default '',
FBASEPURCHASEQTY decimal(23,10) not null default 0.0,
FBASEPRESENTQTY decimal(23,10) not null default 0.0,
FBASEUNITID int not null default 0,
FMATERIALGROUPID int not null default 0,
FMATERIALID int not null default 0,
FMASTERID int not null default 0,
FASSISTPROPERTYID int not null default 0,
FBILLDISCOUNTRATE decimal(23,10) not null default 0.0,
FBILLDISCOUNTAMOUNT decimal(23,10) not null default 0.0,
FPRESENTCYCLEQTY decimal(23,10) not null default 0.0,
FENTRYPRESENTLIMITQTY int not null default 0,
FENTRYPRESENTLIMIT varchar(20) not null default '',
constraint PK_SPM_PROMOTIONPOLICYENTRY primary key (FENTRYID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'促销政策分录',
'user', @CurrentUser, 'table', 'T_SPM_PROMOTIONPOLICYENTRY'
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOPOLICY_FID */
/*==============================================================*/
create index IDX_SPM_PROMOPOLICY_FID on T_SPM_PROMOTIONPOLICYENTRY (
FID ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOPOLICY_MF */
/*==============================================================*/
create index IDX_SPM_PROMOPOLICY_MF on T_SPM_PROMOTIONPOLICYENTRY (
FMATERIALID ASC,
FUNITID ASC,
FID ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOPOLICY_MGF */
/*==============================================================*/
create index IDX_SPM_PROMOPOLICY_MGF on T_SPM_PROMOTIONPOLICYENTRY (
FMATERIALGROUPID ASC,
FID ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOPOLICY_MUGI */
/*==============================================================*/
create index IDX_SPM_PROMOPOLICY_MUGI on T_SPM_PROMOTIONPOLICYENTRY (
FMASTERID ASC,
FUNITID ASC,
FMATERIALGROUPID ASC,
FID ASC
)
go
alter table T_SPM_PROMOTIONPOLICYENTRY
add constraint FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR foreign key (FID)
references T_SPM_PROMOTIONPOLICY (FID)
go

### T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)：键值定义

名称 | 代码 | 主要的
PK_SPM_PROMOTIONPOLICYENTRY | PK_SPM_PROMOTIONPOLICYENTRY | TRUE

### T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_SPM_PROMOPOLICY_FID | IDX_SPM_PROMOPOLICY_FID | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)
IDX_SPM_PROMOPOLICY_MF | IDX_SPM_PROMOPOLICY_MF | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)
IDX_SPM_PROMOPOLICY_MGF | IDX_SPM_PROMOPOLICY_MGF | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)
IDX_SPM_PROMOPOLICY_MUGI | IDX_SPM_PROMOPOLICY_MUGI | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONPOLICYENTRY(促销政策分录)

上一页

主页

下一页