SCO供应链协同

## 数据表：T_SPM_PROMOTIONAPPLY(促销申请)

### T_SPM_PROMOTIONAPPLY(促销申请)：描述

名称 | T_SPM_PROMOTIONAPPLY(促销申请)
代码 | T_SPM_PROMOTIONAPPLY
注释 | 促销申请
模型 | SCO供应链协同
主键 | PK_SPM_PROMOTIONAPPLY

### T_SPM_PROMOTIONAPPLY(促销申请)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
主键ID | FID | int |  | TRUE |
单据编号 | FBILLNO | nvarchar(30) | 30 | TRUE |
单据类型 | FBILLTYPEID | varchar(36) | 36 | FALSE |
状态 | FDOCUMENTSTATUS | char(1) | 1 | TRUE |
申请日期 | FAPPLYDATE | datetime |  | TRUE |
促销开始日期 | FSTARTDATE | datetime |  | TRUE |
促销结束日期 | FENDDATE | datetime |  | TRUE |
申请人 | FAPPLYERID | int |  | TRUE |
促销申请部门 | FAPPLYDEPTID | int |  | TRUE |
结算币别 | FCURRENCYID | int |  | TRUE |
促销申请组织 | FAPPLYORGID | int |  | TRUE |
预计促销总费用 | FCOSTAMOUNT | decimal(23,10) | 23 | TRUE |
预计销售总收入 | FINCOMEAMOUNT | decimal(23,10) | 23 | TRUE |
促销利润增长 | FPROFITINCRATE | decimal(23,10) | 23 | TRUE |
创建人 | FCREATORID | int |  | TRUE |
创建日期 | FCREATEDATE | datetime |  | FALSE |
修改人 | FMODIFIERID | int |  | TRUE |
修改日期 | FMODIFYDATE | datetime |  | FALSE |
审核人 | FAPPROVERID | int |  | TRUE |
审核日期 | FAPPROVEDATE | datetime |  | FALSE |
失效人 | FCANCELLERID | int |  | TRUE |
失效日期 | FCANCELDATE | datetime |  | FALSE |
失效状态 | FCANCELSTATUS | char(1) | 1 | TRUE |
促销主题 | FNAME | nvarchar(100) | 100 | TRUE |
促销目标 | FPROMOTIONTARGET | nvarchar(255) | 255 | TRUE |
促销品种范围 | FTYPERANGE | nvarchar(255) | 255 | TRUE |
促销客户范围 | FCUSTRANGE | nvarchar(255) | 255 | TRUE |
供应商是否参与 | FISJOINSUPPLIER | char(1) | 1 | TRUE |
供应商 | FSUPPLIERID | int |  | TRUE |
是否限量促销 | FISLIMITPROMOTION | char(1) | 1 | TRUE |
费用承担组织 | FCOSTORGID | int |  | TRUE |
费用承担部门 | FCOSTDEPARTMENT | int |  | TRUE |
公司承担总费用 | FORGCOSTALLAMOUNT | decimal(23,10) | 23 | TRUE |
汇率类型 | FEXCHANGETYPEID | int |  | TRUE |
本位币 | FBASECURRENCYID | int |  | TRUE |
汇率 | FEXCHANGERATE | decimal(19,6) | 19 | TRUE |
公司承担总费用（本位币） | FLOCALORGCOSTALLAMOUNT | decimal(23,10) | 23 | TRUE |

### T_SPM_PROMOTIONAPPLY(促销申请)：脚本代码

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_PROMOTIONAPPLYCUST') and o.name = 'FK_T_SPM_PR_R_PROMOTI_T_SPM_PR')
alter table T_SPM_PROMOTIONAPPLYCUST
drop constraint FK_T_SPM_PR_R_PROMOTI_T_SPM_PR
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_SPM_PROMOTIONAPPLYENTRY') and o.name = 'FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONAPPLYENTRY
drop constraint FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR
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_SPM_PROMOTIONAPPLYENTRY_F') and o.name = 'FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONAPPLYENTRY_F
drop constraint FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR
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_SPM_PROMOTIONAPPLYMATENTRY') and o.name = 'FK_T_SPM_PR_R_SPM_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONAPPLYMATENTRY
drop constraint FK_T_SPM_PR_R_SPM_PRO_T_SPM_PR
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_SPM_PROMOTIONAPPLYORG') and o.name = 'FK_T_SPM_PR_R_SPM_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONAPPLYORG
drop constraint FK_T_SPM_PR_R_SPM_PRO_T_SPM_PR
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_SPM_PROMOTIONAPPLYPMATENTRY') and o.name = 'FK_T_SPM_PR_REFERENCE_T_SPM_PR')
alter table T_SPM_PROMOTIONAPPLYPMATENTRY
drop constraint FK_T_SPM_PR_REFERENCE_T_SPM_PR
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_SPM_PROMOTIONAPPLY_L') and o.name = 'FK_T_SPM_PR_R_DRP_PRO_T_SPM_PR')
alter table T_SPM_PROMOTIONAPPLY_L
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_PROMOTIONAPPLY')
and name = 'IDX_SPM_PROMOAPP_RDATE'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONAPPLY.IDX_SPM_PROMOAPP_RDATE
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONAPPLY')
and name = 'IDX_SPM_PROMOAPP_PLANDATE'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONAPPLY.IDX_SPM_PROMOAPP_PLANDATE
go
if exists (select 1
from sysindexes
where id = object_id('T_SPM_PROMOTIONAPPLY')
and name = 'IDX_SPM_PROMOAPP_NO'
and indid > 0
and indid < 255)
drop index T_SPM_PROMOTIONAPPLY.IDX_SPM_PROMOAPP_NO
go
if exists (select 1
from sysobjects
where id = object_id('T_SPM_PROMOTIONAPPLY')
and type = 'U')
drop table T_SPM_PROMOTIONAPPLY
go
/*==============================================================*/
/* Table: T_SPM_PROMOTIONAPPLY */
/*==============================================================*/
create table T_SPM_PROMOTIONAPPLY (
FID int not null default 0,
FBILLNO nvarchar(30) not null default '',
FBILLTYPEID varchar(36) null,
FDOCUMENTSTATUS char(1) not null default '',
FAPPLYDATE datetime not null default getdate(),
FSTARTDATE datetime not null default getdate(),
FENDDATE datetime not null default getdate(),
FAPPLYERID int not null default 0,
FAPPLYDEPTID int not null default 0,
FCURRENCYID int not null default 0
constraint CKC_FCURRENCYID_T_SPM_PR check (FCURRENCYID >= 0),
FAPPLYORGID int not null default 0,
FCOSTAMOUNT decimal(23,10) not null default 0.0,
FINCOMEAMOUNT decimal(23,10) not null default 0.0,
FPROFITINCRATE decimal(23,10) not null default 0.0,
FCREATORID int not null default 0,
FCREATEDATE datetime null,
FMODIFIERID int not null default 0,
FMODIFYDATE datetime null,
FAPPROVERID int not null default 0,
FAPPROVEDATE datetime null,
FCANCELLERID int not null default 0,
FCANCELDATE datetime null,
FCANCELSTATUS char(1) not null default '',
FNAME nvarchar(100) not null default '',
FPROMOTIONTARGET nvarchar(255) not null default '',
FTYPERANGE nvarchar(255) not null default '',
FCUSTRANGE nvarchar(255) not null default '',
FISJOINSUPPLIER char(1) not null default '',
FSUPPLIERID int not null default 0,
FISLIMITPROMOTION char(1) not null default '',
FCOSTORGID int not null default 0,
FCOSTDEPARTMENT int not null default 0,
FORGCOSTALLAMOUNT decimal(23,10) not null default 0.0,
FEXCHANGETYPEID int not null default 0,
FBASECURRENCYID int not null default 0,
FEXCHANGERATE decimal(19,6) not null default 0,
FLOCALORGCOSTALLAMOUNT decimal(23,10) not null default 0.0,
constraint PK_SPM_PROMOTIONAPPLY primary key (FID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'促销申请',
'user', @CurrentUser, 'table', 'T_SPM_PROMOTIONAPPLY'
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOAPP_NO */
/*==============================================================*/
create index IDX_SPM_PROMOAPP_NO on T_SPM_PROMOTIONAPPLY (
FBILLNO ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOAPP_PLANDATE */
/*==============================================================*/
create index IDX_SPM_PROMOAPP_PLANDATE on T_SPM_PROMOTIONAPPLY (
FAPPLYORGID ASC,
FAPPLYDATE ASC,
FDOCUMENTSTATUS ASC
)
go
/*==============================================================*/
/* Index: IDX_SPM_PROMOAPP_RDATE */
/*==============================================================*/
create index IDX_SPM_PROMOAPP_RDATE on T_SPM_PROMOTIONAPPLY (
FSTARTDATE ASC,
FENDDATE ASC,
FAPPLYORGID ASC,
FDOCUMENTSTATUS ASC
)
go

### T_SPM_PROMOTIONAPPLY(促销申请)：键值定义

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

### T_SPM_PROMOTIONAPPLY(促销申请)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_SPM_PROMOAPP_NO | IDX_SPM_PROMOAPP_NO | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONAPPLY(促销申请)
IDX_SPM_PROMOAPP_PLANDATE | IDX_SPM_PROMOAPP_PLANDATE | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONAPPLY(促销申请)
IDX_SPM_PROMOAPP_RDATE | IDX_SPM_PROMOAPP_RDATE | FALSE | FALSE | FALSE | FALSE | FALSE | T_SPM_PROMOTIONAPPLY(促销申请)

上一页

主页

下一页