SCO供应链协同

## 数据表：T_DRP_NEEDAPP(要货申请单)

### T_DRP_NEEDAPP(要货申请单)：描述

名称 | T_DRP_NEEDAPP(要货申请单)
代码 | T_DRP_NEEDAPP
注释 | (要货申请单)
模型 | SCO供应链协同
主键 | PK_DRP_NEEDAPP

### T_DRP_NEEDAPP(要货申请单)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
主键 | FID | int |  | TRUE |
单据类型 | FBILLTYPEID | varchar(36) | 36 | TRUE |
单据编号 | FBILLNO | nvarchar(30) | 30 | TRUE |
要货组织 | FREQORGID | int |  | TRUE |
要货渠道 | FREQCHANNELID | int |  | TRUE |
供货渠道 | FSUPPLYCHANNELID | int |  | TRUE |
供货组织 | FSUPPLYORGID | int |  | TRUE |
申请人 | FAPPUSERID | int |  | TRUE |
申请日期 | FDATE | datetime |  | FALSE |
结算币别 | FSETTLECURRID | int |  | TRUE |
单据状态 | FDOCUMENTSTATUS | char(1) | 1 | TRUE |
创建人 | FCREATORID | int |  | TRUE |
创建日期 | FCREATEDATE | datetime |  | FALSE |
修改人 | FMODIFIERID | int |  | TRUE |
修改日期 | FMODIFYDATE | datetime |  | FALSE |
审核人 | FAPPROVERID | int |  | TRUE |
审核日期 | FAPPROVEDATE | datetime |  | FALSE |
关闭状态 | FCLOSESTATUS | char(1) | 1 | TRUE | 状态字段 A：未关闭 B：已关闭
关闭人 | FCLOSERID | int |  | TRUE |
关闭日期 | FCLOSEDATE | datetime |  | FALSE |
作废状态 | FCANCELSTATUS | char(1) | 1 | TRUE | 状态字段 A：未作废 B：已作废
作废人 | FCANCELLERID | int |  | TRUE |
作废日期 | FCANCELDATE | datetime |  | FALSE |
价目表 | FPRICELISTID | int |  | TRUE |
折扣表 | FDISCOUNTLISTID | int |  | TRUE |
是否含税 | FISINCLUDEDTAX | char(1) | 1 | TRUE |
单据分类 | FOBJECTTYPEID | varchar(36) | 36 | TRUE |
备注 | FNOTE | nvarchar(255) | 255 | FALSE |
要货客户 | FREQCUSTID | int |  | TRUE |
要货部门 | FREQDEPTID | int |  | TRUE |
来源类型 | FSRCTYPE | char(1) | 1 | TRUE | "1" 订货下达
业务类型 | FBUSINESSTYPE | varchar(20) | 20 | TRUE |
供应商 | FSUPPLIERID | int |  | TRUE |

### T_DRP_NEEDAPP(要货申请单)：脚本代码

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_DRP_NEEDAPPENTRY') and o.name = 'FK_T_DRP_NE_REFERENCE_T_DRP_NE')
alter table T_DRP_NEEDAPPENTRY
drop constraint FK_T_DRP_NE_REFERENCE_T_DRP_NE
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_DRP_NEEDAPPENTRY_F') and o.name = 'FK_T_DRP_NE_REFERENCE_T_DRP_NE')
alter table T_DRP_NEEDAPPENTRY_F
drop constraint FK_T_DRP_NE_REFERENCE_T_DRP_NE
go
if exists (select 1
from sysindexes
where id = object_id('T_DRP_NEEDAPP')
and name = 'IDX_DRP_NEEDAPP_SUPCHA'
and indid > 0
and indid < 255)
drop index T_DRP_NEEDAPP.IDX_DRP_NEEDAPP_SUPCHA
go
if exists (select 1
from sysindexes
where id = object_id('T_DRP_NEEDAPP')
and name = 'IDX_DRP_NEEDAPP_NUM'
and indid > 0
and indid < 255)
drop index T_DRP_NEEDAPP.IDX_DRP_NEEDAPP_NUM
go
if exists (select 1
from sysindexes
where id = object_id('T_DRP_NEEDAPP')
and name = 'IDX_DRP_NEEDAPP_REQCHA'
and indid > 0
and indid < 255)
drop index T_DRP_NEEDAPP.IDX_DRP_NEEDAPP_REQCHA
go
if exists (select 1
from sysindexes
where id = object_id('T_DRP_NEEDAPP')
and name = 'IDX_DRP_NEEDAPP_DATE'
and indid > 0
and indid < 255)
drop index T_DRP_NEEDAPP.IDX_DRP_NEEDAPP_DATE
go
if exists (select 1
from sysobjects
where id = object_id('T_DRP_NEEDAPP')
and type = 'U')
drop table T_DRP_NEEDAPP
go
/*==============================================================*/
/* Table: T_DRP_NEEDAPP */
/*==============================================================*/
create table T_DRP_NEEDAPP (
FID int not null default 0,
FBILLTYPEID varchar(36) not null default '',
FBILLNO nvarchar(30) not null default '',
FREQORGID int not null default 0,
FREQCHANNELID int not null default 0,
FSUPPLYCHANNELID int not null default 0,
FSUPPLYORGID int not null default 0,
FAPPUSERID int not null default 0,
FDATE datetime null,
FSETTLECURRID int not null default 0
constraint CKC_FSETTLECURRID_T_DRP_NE check (FSETTLECURRID >= 0),
FDOCUMENTSTATUS char(1) not null default 'Z',
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,
FCLOSESTATUS char(1) not null default 'A',
FCLOSERID int not null default 0,
FCLOSEDATE datetime null,
FCANCELSTATUS char(1) not null default 'A',
FCANCELLERID int not null default 0,
FCANCELDATE datetime null,
FPRICELISTID int not null default 0,
FDISCOUNTLISTID int not null default 0,
FISINCLUDEDTAX char(1) not null default '0',
FOBJECTTYPEID varchar(36) not null default '',
FNOTE nvarchar(255) null,
FREQCUSTID int not null default 0,
FREQDEPTID int not null default 0,
FSRCTYPE char(1) not null default '',
FBUSINESSTYPE varchar(20) not null default '',
FSUPPLIERID int not null default 0,
constraint PK_DRP_NEEDAPP primary key (FID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'(要货申请单)',
'user', @CurrentUser, 'table', 'T_DRP_NEEDAPP'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'状态字段
A：未关闭
B：已关闭',
'user', @CurrentUser, 'table', 'T_DRP_NEEDAPP', 'column', 'FCLOSESTATUS'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'状态字段
A：未作废
B：已作废',
'user', @CurrentUser, 'table', 'T_DRP_NEEDAPP', 'column', 'FCANCELSTATUS'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'"1" 订货下达',
'user', @CurrentUser, 'table', 'T_DRP_NEEDAPP', 'column', 'FSRCTYPE'
go
/*==============================================================*/
/* Index: IDX_DRP_NEEDAPP_DATE */
/*==============================================================*/
create index IDX_DRP_NEEDAPP_DATE on T_DRP_NEEDAPP (
FDATE ASC,
FDOCUMENTSTATUS ASC
)
go
/*==============================================================*/
/* Index: IDX_DRP_NEEDAPP_REQCHA */
/*==============================================================*/
create index IDX_DRP_NEEDAPP_REQCHA on T_DRP_NEEDAPP (
FREQCHANNELID ASC,
FSUPPLYORGID ASC
)
go
/*==============================================================*/
/* Index: IDX_DRP_NEEDAPP_NUM */
/*==============================================================*/
create index IDX_DRP_NEEDAPP_NUM on T_DRP_NEEDAPP (
FBILLNO ASC
)
go
/*==============================================================*/
/* Index: IDX_DRP_NEEDAPP_SUPCHA */
/*==============================================================*/
create index IDX_DRP_NEEDAPP_SUPCHA on T_DRP_NEEDAPP (
FREQORGID ASC,
FSUPPLYCHANNELID ASC
)
go

### T_DRP_NEEDAPP(要货申请单)：键值定义

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

### T_DRP_NEEDAPP(要货申请单)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_DRP_NEEDAPP_DATE | IDX_DRP_NEEDAPP_DATE | FALSE | FALSE | FALSE | FALSE | FALSE | T_DRP_NEEDAPP(要货申请单)
IDX_DRP_NEEDAPP_REQCHA | IDX_DRP_NEEDAPP_REQCHA | FALSE | FALSE | FALSE | FALSE | FALSE | T_DRP_NEEDAPP(要货申请单)
IDX_DRP_NEEDAPP_NUM | IDX_DRP_NEEDAPP_NUM | FALSE | FALSE | FALSE | FALSE | FALSE | T_DRP_NEEDAPP(要货申请单)
IDX_DRP_NEEDAPP_SUPCHA | IDX_DRP_NEEDAPP_SUPCHA | FALSE | FALSE | FALSE | FALSE | FALSE | T_DRP_NEEDAPP(要货申请单)

上一页

主页

下一页