SCO供应链协同

## 数据表：T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)

### T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)：描述

名称 | T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)
代码 | T_SPM_PROMOTIONCOUNTENTRY
注释 |
模型 | SCO供应链协同
主键 | PK_SPM_PROMOTIONCOUNTENTRY

### T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
分录主键 | FENTRYID | int |  | TRUE |
主表ID | FID | int |  | TRUE |
分录序号 | FSEQ | int |  | TRUE |
促销政策分录ID | FPOLICYENTRYID | int |  | TRUE |
组号 | FGROUPNUMBER | int |  | TRUE |
物料分组 | FMATERIALGROUPID | int |  | TRUE |
物料ID | FMATERIALID | int |  | TRUE |
物料分配内码 | FMATMASTERID | int |  | TRUE |
基本计量单位 | FBASEUNITID | int |  | TRUE |
计量单位 | FUNITID | int |  | TRUE |
辅助属性 | FAUXPROPID | int |  | TRUE |
初始累计基本数量 | FBASEINITQTY | decimal(23,10) | 23 | TRUE |
初始累计数量 | FINITQTY | decimal(23,10) | 23 | TRUE |
初始累计金额 | FINITAMOUNT | decimal(23,10) | 23 | TRUE |
促销累计基本数量 | FBASESPMCOUNTQTY | decimal(23,10) | 23 | TRUE |
促销累计数量 | FSPMCOUNTQTY | decimal(23,10) | 23 | TRUE |
促销累计金额 | FSPMCOUNTAMOUNT | decimal(23,10) | 23 | TRUE |
赠品累计赠送基本数量 | FBASEPRESENTCOUNTQTY | decimal(23,10) | 23 | TRUE |
赠品累计赠送数量 | FPRESENTCOUNTQTY | decimal(23,10) | 23 | TRUE |
赠品 | FPRESENTCOUNT | varchar(20) | 20 | TRUE | 1：赠品 2：换赠
促销累计总数量 | FQTY | decimal(23,10) | 23 | TRUE |
促销累计基本总数量 | FBASEQTY | decimal(23,10) | 23 | TRUE |
促销累计总金额 | FAMOUNT | decimal(23,10) | 23 | TRUE |

### T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)：脚本代码

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_PROMOTIONCOUNTENTRY') and o.name = 'FK_T_SPM_PR_REFERENCE_T_SPM_PR')
alter table T_SPM_PROMOTIONCOUNTENTRY
drop constraint FK_T_SPM_PR_REFERENCE_T_SPM_PR
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONCOUNTENTRY')
and name = 'IDX_SPM_PROMOTIONCOUNTE_MG'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONCOUNTENTRY.IDX_SPM_PROMOTIONCOUNTE_MG
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONCOUNTENTRY')
and name = 'IDX_SPM_PROMOTIONCOUNTE_M'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONCOUNTENTRY.IDX_SPM_PROMOTIONCOUNTE_M
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONCOUNTENTRY')
and name = 'IDX_SPM_PROMOTIONCOUNTE_ID'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONCOUNTENTRY.IDX_SPM_PROMOTIONCOUNTE_ID
go
if exists (select 1
from sysobjects
where id = object_id('T_SPM_PROMOTIONCOUNTENTRY')
and type = 'U')
drop table T_SPM_PROMOTIONCOUNTENTRY
go
/*==============================================================*/
/* Table: T_SPM_PROMOTIONCOUNTENTRY */
/*==============================================================*/
create table T_SPM_PROMOTIONCOUNTENTRY (
FENTRYID int not null default 0,
FID int not null default 0,
FSEQ int not null default 0,
FPOLICYENTRYID int not null default 0,
FGROUPNUMBER int not null default 0,
FMATERIALGROUPID int not null default 0,
FMATERIALID int not null default 0,
FMATMASTERID int not null default 0,
FBASEUNITID int not null default 0,
FUNITID int not null default 0,
FAUXPROPID int not null default 0,
FBASEINITQTY decimal(23,10) not null default 0,
FINITQTY decimal(23,10) not null default 0,
FINITAMOUNT decimal(23,10) not null default 0,
FBASESPMCOUNTQTY decimal(23,10) not null default 0,
FSPMCOUNTQTY decimal(23,10) not null default 0,
FSPMCOUNTAMOUNT decimal(23,10) not null default 0,
FBASEPRESENTCOUNTQTY decimal(23,10) not null default 0,
FPRESENTCOUNTQTY decimal(23,10) not null default 0,
FPRESENTCOUNT varchar(20) not null default '',
FQTY decimal(23,10) not null default 0,
FBASEQTY decimal(23,10) not null default 0,
FAMOUNT decimal(23,10) not null default 0,
constraint PK_SPM_PROMOTIONCOUNTENTRY primary key (FENTRYID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'1：赠品
2：换赠',
'user', @CurrentUser, 'table', 'T_SPM_PROMOTIONCOUNTENTRY', 'column', 'FPRESENTCOUNT'
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOTIONCOUNTE_ID */
/*==============================================================*/
create index IDX_SPM_PROMOTIONCOUNTE_ID on T_SPM_PROMOTIONCOUNTENTRY (
FID ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOTIONCOUNTE_M */
/*==============================================================*/
create index IDX_SPM_PROMOTIONCOUNTE_M on T_SPM_PROMOTIONCOUNTENTRY (
FMATMASTERID ASC,
FMATERIALGROUPID ASC,
FID ASC,
FGROUPNUMBER ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOTIONCOUNTE_MG */
/*==============================================================*/
create index IDX_SPM_PROMOTIONCOUNTE_MG on T_SPM_PROMOTIONCOUNTENTRY (
FMATERIALGROUPID ASC,
FMATERIALID ASC,
FID ASC
)
go
alter table T_SPM_PROMOTIONCOUNTENTRY
add constraint FK_T_SPM_PR_REFERENCE_T_SPM_PR foreign key (FID)
references T_SPM_PROMOTIONCOUNT (FID)
go

### T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)：键值定义

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

### T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_SPM_PROMOTIONCOUNTE_ID | IDX_SPM_PROMOTIONCOUNTE_ID | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)
IDX_SPM_PROMOTIONCOUNTE_M | IDX_SPM_PROMOTIONCOUNTE_M | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)
IDX_SPM_PROMOTIONCOUNTE_MG | IDX_SPM_PROMOTIONCOUNTE_MG | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONCOUNTENTRY(促销政策促销累计统计分录表)

上一页

主页

下一页