SCO供应链协同

## 数据表：T_RPM_RETURNPROFITWAY(返利方式)

### T_RPM_RETURNPROFITWAY(返利方式)：描述

名称 | T_RPM_RETURNPROFITWAY(返利方式)
代码 | T_RPM_RETURNPROFITWAY
注释 | 返利方式
模型 | SCO供应链协同
主键 | PK_RPM_RETURNPROFITWAY

### T_RPM_RETURNPROFITWAY(返利方式)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
主键ID | FRETURNPROFITWAYID | int |  | TRUE |
编码 | FNUMBER | nvarchar(30) | 30 | TRUE |
返利类型 | FRPTYPEID | int |  | TRUE |
是否系统预置 | FISSYSTEM | char(1) | 1 | TRUE | 0：否 1：是
禁用状态 | FFORBIDSTATUS | char(1) | 1 | TRUE | 0:禁用 1：启用
返利周期类型 | FRPCIRCLETYPE | varchar(20) | 20 | TRUE |
返利返还方式 | FRETURNTYPE | varchar(20) | 20 | TRUE | 1:结转到返利账户 2:冲减应收账 3:其他应付款 4:赠品出库返还

### T_RPM_RETURNPROFITWAY(返利方式)：脚本代码

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_RETURNPROFITWAY') and o.name = 'FK_T_RPM_RE_R_RPTYPE__T_RPM_RE')
alter table T_RPM_RETURNPROFITWAY
drop constraint FK_T_RPM_RE_R_RPTYPE__T_RPM_RE
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_RETURNPROFITWAY_L') and o.name = 'FK_T_RPM_RE_R_RPWAY_L_T_RPM_RE')
alter table T_RPM_RETURNPROFITWAY_L
drop constraint FK_T_RPM_RE_R_RPWAY_L_T_RPM_RE
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_RPMODE') and o.name = 'FK_T_RPM_RP_R_RPMODE__T_RPM_RE')
alter table T_RPM_RPMODE
drop constraint FK_T_RPM_RP_R_RPMODE__T_RPM_RE
go
if exists (select 1
from sysindexes
where id = object_id('T_RPM_RETURNPROFITWAY')
and name = 'IDX_RPM_RETURNPROFITWAY_NUM'
and indid > 0
and indid < 255)
drop index T_RPM_RETURNPROFITWAY.IDX_RPM_RETURNPROFITWAY_NUM
go
if exists (select 1
from sysobjects
where id = object_id('T_RPM_RETURNPROFITWAY')
and type = 'U')
drop table T_RPM_RETURNPROFITWAY
go
/*==============================================================*/
/* Table: T_RPM_RETURNPROFITWAY */
/*==============================================================*/
create table T_RPM_RETURNPROFITWAY (
FRETURNPROFITWAYID int not null default 0,
FNUMBER nvarchar(30) not null default '',
FRPTYPEID int not null default 0,
FISSYSTEM char(1) not null default '0',
FFORBIDSTATUS char(1) not null default '',
FRPCIRCLETYPE varchar(20) not null default '',
FRETURNTYPE varchar(20) not null default '',
constraint PK_RPM_RETURNPROFITWAY primary key (FRETURNPROFITWAYID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'返利方式',
'user', @CurrentUser, 'table', 'T_RPM_RETURNPROFITWAY'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'0：否 1：是',
'user', @CurrentUser, 'table', 'T_RPM_RETURNPROFITWAY', 'column', 'FISSYSTEM'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'0:禁用
1：启用',
'user', @CurrentUser, 'table', 'T_RPM_RETURNPROFITWAY', 'column', 'FFORBIDSTATUS'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'1:结转到返利账户
2:冲减应收账
3:其他应付款
4:赠品出库返还',
'user', @CurrentUser, 'table', 'T_RPM_RETURNPROFITWAY', 'column', 'FRETURNTYPE'
go
/*==============================================================*/
/* Index: IDX_RPM_RETURNPROFITWAY_NUM */
/*==============================================================*/
create index IDX_RPM_RETURNPROFITWAY_NUM on T_RPM_RETURNPROFITWAY (
FNUMBER ASC
)
go
alter table T_RPM_RETURNPROFITWAY
add constraint FK_T_RPM_RE_R_RPTYPE__T_RPM_RE foreign key (FRPTYPEID)
references T_RPM_RETURNPROFITTYPE (FRPTYPEID)
go

### T_RPM_RETURNPROFITWAY(返利方式)：键值定义

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

### T_RPM_RETURNPROFITWAY(返利方式)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_RPM_RETURNPROFITWAY_NUM | IDX_RPM_RETURNPROFITWAY_NUM | FALSE | FALSE | FALSE | FALSE | FALSE | T_RPM_RETURNPROFITWAY(返利方式)

上一页

主页

下一页