SCO供应链协同

## 数据表：T_RPM_RPPOLICYENTRY(返利政策明细)

### T_RPM_RPPOLICYENTRY(返利政策明细)：描述

名称 | T_RPM_RPPOLICYENTRY(返利政策明细)
代码 | T_RPM_RPPOLICYENTRY
注释 | 返利政策明细
模型 | SCO供应链协同
主键 | PK_RPM_RPPOLICYENTRY

### T_RPM_RPPOLICYENTRY(返利政策明细)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
分录主键 | FENTRYID | int |  | TRUE |
分录行号 | FSEQ | int |  | TRUE |
返利政策ID | FID | int |  | TRUE |
组号 | FGROUPNUMBER | int |  | TRUE |
返利周期 | FRPCYCLEID | int |  | TRUE |
物料分组 | FMATERIALGROUPID | int |  | TRUE |
物料内码 | FMATMASTERID | int |  | TRUE |
物料编码 | FMATERIALID | int |  | TRUE |
辅助属性 | FASSISTPROPERTYID | int |  | TRUE |
计量单位 | FUNITID | int |  | TRUE |
基本计量单位 | FBASEUNITID | int |  | TRUE |
购买数量 | FPURCHASEQTY | decimal(23,10) | 23 | TRUE |
基本购买数量 | FBASEPURCHASEQTY | decimal(23,10) | 23 | TRUE |
购买金额 | FPURCHASEAMOUNT | decimal(23,10) | 23 | TRUE |
指标数量 | FTARGETQTY | decimal(23,10) | 23 | TRUE |
指标基本单位数量 | FBASETARGETQTY | decimal(23,10) | 23 | TRUE |
指标金额 | FTARGETAMOUNT | decimal(23,10) | 23 | TRUE |
指标完成率 | FTARGETRATE | decimal(19,6) | 19 | TRUE |
返利方式 | FRPTYPE | varchar(20) | 20 | TRUE | 1.返利率 2.返利额 3.返物品
赠品 | FPRESENTTYPE | varchar(20) | 20 | TRUE | 1. 赠品 2. 换赠 但业务上要求只能是1.赠品。
赠品数量 | FENTRYPRESENTQTY | decimal(23,10) | 23 | TRUE |
赠品赠送基数 | FPRESENTCYCLENUM | decimal(23,10) | 23 | TRUE |
基本赠品数量 | FBASEPRESENTQTY | decimal(23,10) | 23 | TRUE |
返利率 | FRPRATE | decimal(19,6) | 19 | TRUE |
单位返利额 | FRPAMOUNT | decimal(23,10) | 23 | TRUE |
备注 | FREMARK | nvarchar(255) | 255 | TRUE |
固定返利额 | FRPFIXAMOUNT | decimal(23,10) | 23 | TRUE |

### T_RPM_RPPOLICYENTRY(返利政策明细)：脚本代码

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_RPM_RPPOLICYENTRY') and o.name = 'FK_T_RPM_RP_R_RPM_POL_T_RPM_RP')
alter table T_RPM_RPPOLICYENTRY
drop constraint FK_T_RPM_RP_R_RPM_POL_T_RPM_RP
go
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_RPM_RPPOLICYENTRY') and o.name = 'FK_T_RPM_RP_R_RPPOLIC_T_RPM_RE')
alter table T_RPM_RPPOLICYENTRY
drop constraint FK_T_RPM_RP_R_RPPOLIC_T_RPM_RE
go
if exists (select 1
from sysindexes
where id = object_id('T_RPM_RPPOLICYENTRY')
and name = 'IDX_RPM_RPPOLICYENTRY_ID'
and indid > 0
and indid < 255)
drop index T_RPM_RPPOLICYENTRY.IDX_RPM_RPPOLICYENTRY_ID
go
if exists (select 1
from sysindexes
where id = object_id('T_RPM_RPPOLICYENTRY')
and name = 'IDX_RPM_RPPOLICYENTRY_MAT'
and indid > 0
and indid < 255)
drop index T_RPM_RPPOLICYENTRY.IDX_RPM_RPPOLICYENTRY_MAT
go
if exists (select 1
from sysindexes
where id = object_id('T_RPM_RPPOLICYENTRY')
and name = 'IDX_RPM_RPPOLICYENTRY_MG'
and indid > 0
and indid < 255)
drop index T_RPM_RPPOLICYENTRY.IDX_RPM_RPPOLICYENTRY_MG
go
if exists (select 1
from sysobjects
where id = object_id('T_RPM_RPPOLICYENTRY')
and type = 'U')
drop table T_RPM_RPPOLICYENTRY
go
/*==============================================================*/
/* Table: T_RPM_RPPOLICYENTRY */
/*==============================================================*/
create table T_RPM_RPPOLICYENTRY (
FENTRYID int not null default 0,
FSEQ int not null default 0,
FID int not null default 0,
FGROUPNUMBER int not null default 1,
FRPCYCLEID int not null default 0,
FMATERIALGROUPID int not null default 0,
FMATMASTERID int not null default 0,
FMATERIALID int not null default 0,
FASSISTPROPERTYID int not null default 0,
FUNITID int not null default 0,
FBASEUNITID int not null default 0,
FPURCHASEQTY decimal(23,10) not null default 0.0,
FBASEPURCHASEQTY decimal(23,10) not null default 0.0,
FPURCHASEAMOUNT decimal(23,10) not null default 0.0,
FTARGETQTY decimal(23,10) not null default 0.0,
FBASETARGETQTY decimal(23,10) not null default 0.0,
FTARGETAMOUNT decimal(23,10) not null default 0.0,
FTARGETRATE decimal(19,6) not null default 0.0,
FRPTYPE varchar(20) not null default '',
FPRESENTTYPE varchar(20) not null default '',
FENTRYPRESENTQTY decimal(23,10) not null default 0.0,
FPRESENTCYCLENUM decimal(23,10) not null default 0.0,
FBASEPRESENTQTY decimal(23,10) not null default 0.0,
FRPRATE decimal(19,6) not null default 0.0,
FRPAMOUNT decimal(23,10) not null default 0.0,
FREMARK nvarchar(255) not null default '',
FRPFIXAMOUNT decimal(23,10) not null default 0.0,
constraint PK_RPM_RPPOLICYENTRY primary key (FENTRYID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'返利政策明细',
'user', @CurrentUser, 'table', 'T_RPM_RPPOLICYENTRY'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'1.返利率 2.返利额 3.返物品',
'user', @CurrentUser, 'table', 'T_RPM_RPPOLICYENTRY', 'column', 'FRPTYPE'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'1. 赠品 2. 换赠
但业务上要求只能是1.赠品。',
'user', @CurrentUser, 'table', 'T_RPM_RPPOLICYENTRY', 'column', 'FPRESENTTYPE'
go
/*==============================================================*/
/* Index: IDX_RPM_RPPOLICYENTRY_MG */
/*==============================================================*/
create index IDX_RPM_RPPOLICYENTRY_MG on T_RPM_RPPOLICYENTRY (
FMATERIALGROUPID ASC
)
go
/*==============================================================*/
/* Index: IDX_RPM_RPPOLICYENTRY_MAT */
/*==============================================================*/
create index IDX_RPM_RPPOLICYENTRY_MAT on T_RPM_RPPOLICYENTRY (
FMATERIALID ASC,
FUNITID ASC
)
go
/*==============================================================*/
/* Index: IDX_RPM_RPPOLICYENTRY_ID */
/*==============================================================*/
create index IDX_RPM_RPPOLICYENTRY_ID on T_RPM_RPPOLICYENTRY (
FID ASC
)
go
alter table T_RPM_RPPOLICYENTRY
add constraint FK_T_RPM_RP_R_RPM_POL_T_RPM_RP foreign key (FID)
references T_RPM_RPPOLICY (FID)
go
alter table T_RPM_RPPOLICYENTRY
add constraint FK_T_RPM_RP_R_RPPOLIC_T_RPM_RE foreign key (FRPCYCLEID)
references T_RPM_RETURNCYCLE (FRPCYCLEID)
go

### T_RPM_RPPOLICYENTRY(返利政策明细)：键值定义

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

### T_RPM_RPPOLICYENTRY(返利政策明细)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_RPM_RPPOLICYENTRY_MG | IDX_RPM_RPPOLICYENTRY_MG | FALSE | FALSE | FALSE | FALSE | FALSE | T_RPM_RPPOLICYENTRY(返利政策明细)
IDX_RPM_RPPOLICYENTRY_MAT | IDX_RPM_RPPOLICYENTRY_MAT | FALSE | FALSE | FALSE | FALSE | FALSE | T_RPM_RPPOLICYENTRY(返利政策明细)
IDX_RPM_RPPOLICYENTRY_ID | IDX_RPM_RPPOLICYENTRY_ID | FALSE | FALSE | FALSE | FALSE | FALSE | T_RPM_RPPOLICYENTRY(返利政策明细)

上一页

主页

下一页