集团财务

## 数据表：T_CR_CurrencyScheme(外币折算方案)

### T_CR_CurrencyScheme(外币折算方案)：描述

名称 | T_CR_CurrencyScheme(外币折算方案)
代码 | T_CR_CurrencyScheme
注释 | 外币折算方案
模型 | 集团财务
主键 | PK_CR_CurrencyScheme

### T_CR_CurrencyScheme(外币折算方案)：列规格定义

名称 | 代码 | 数据类型 | 长度 | 强制 | 注释
内码 | FID | int |  | TRUE |
编码 | FBillNo | nvarchar(80) | 80 | TRUE |
项目折算方案 | FItemSchemeId | int |  | FALSE |
汇率类型 | FRateTypeId | int |  | FALSE |
折算目标币别 | FTarCurrencyId | int |  | FALSE |
折算差异项目 | FItemId | int |  | FALSE |
历史汇率折算公式 | FRateFormula | char(1) | 1 | TRUE | 0按项目历史汇率记录计算，1按报表项目变动额计算
合并方案 | FScopeTypeId | int |  | TRUE |
折算范围报表类型 | FTransRptType | char(1) | 1 | TRUE | 0所有类型 1仅个别报表、抵消表 2仅调整报表 3调整报表优先
创建人 | FCreatorId | int |  | TRUE |
创建日期 | FCreateDate | datetime |  | FALSE |
修改人 | FModifierId | int |  | TRUE |
修改日期 | FModifyDate | datetime |  | FALSE |
审核人 | FAPPROVERID | int |  | TRUE |
审核日期 | FAPPROVEDATE | datetime |  | FALSE |
作废人 | FCANCELLERID | int |  | TRUE |
作废日期 | FCANCELDATE | datetime |  | FALSE |
数据状态 | FDocumentStatus | char(1) | 1 | TRUE | Z暂存，A创建，B审核中，C已审核，D重新审核
作废状态 | FCANCELSTATUS | char(1) | 1 | TRUE | A否，B是
折算差异项目公式 | FITEMFORMULA | ntext |  | TRUE |

### T_CR_CurrencyScheme(外币折算方案)：脚本代码

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_CR_CurrSchemeEntry') and o.name = 'FK_T_CR_CUR_REFERENCE_T_CR_CUR')
alter table T_CR_CurrSchemeEntry
drop constraint FK_T_CR_CUR_REFERENCE_T_CR_CUR
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_CR_CurrSchemeEntryCmp') and o.name = 'FK_T_CR_CUR_REFERENCE_T_CR_CUR')
alter table T_CR_CurrSchemeEntryCmp
drop constraint FK_T_CR_CUR_REFERENCE_T_CR_CUR
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_CR_CurrSchemeEntryCurr') and o.name = 'FK_T_CR_CUR_REFERENCE_T_CR_CUR')
alter table T_CR_CurrSchemeEntryCurr
drop constraint FK_T_CR_CUR_REFERENCE_T_CR_CUR
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_CR_CurrSchemeEntryTmp') and o.name = 'FK_T_CR_CUR_REFERENCE_T_CR_CUR')
alter table T_CR_CurrSchemeEntryTmp
drop constraint FK_T_CR_CUR_REFERENCE_T_CR_CUR
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_CR_CurrencyScheme_L') and o.name = 'FK_T_CR_CUR_REFERENCE_T_CR_CUR')
alter table T_CR_CurrencyScheme_L
drop constraint FK_T_CR_CUR_REFERENCE_T_CR_CUR
go
if exists (select 1
from sysindexes
where id = object_id('T_CR_CurrencyScheme')
and name = 'IDX_CR_CurrScheme_CREATEDATE'
and indid > 0
and indid < 255)
drop index T_CR_CurrencyScheme.IDX_CR_CurrScheme_CREATEDATE
go
if exists (select 1
from sysindexes
where id = object_id('T_CR_CurrencyScheme')
and name = 'IDX_CR_CurrScheme_FNumber'
and indid > 0
and indid < 255)
drop index T_CR_CurrencyScheme.IDX_CR_CurrScheme_FNumber
go
if exists (select 1
from sysobjects
where id = object_id('T_CR_CurrencyScheme')
and type = 'U')
drop table T_CR_CurrencyScheme
go
/*==============================================================*/
/* Table: T_CR_CurrencyScheme */
/*==============================================================*/
create table T_CR_CurrencyScheme (
FID int not null default 0,
FBillNo nvarchar(80) not null default ' ',
FItemSchemeId int null,
FRateTypeId int null,
FTarCurrencyId int null,
FItemId int null,
FRateFormula char(1) not null default '0',
FScopeTypeId int not null default 0,
FTransRptType char(1) not null default '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,
FDocumentStatus char(1) not null default 'A',
FCANCELSTATUS char(1) not null default 'A',
FITEMFORMULA ntext not null default ' ',
constraint PK_CR_CurrencyScheme primary key (FID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'外币折算方案',
'user', @CurrentUser, 'table', 'T_CR_CurrencyScheme'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'0按项目历史汇率记录计算，1按报表项目变动额计算',
'user', @CurrentUser, 'table', 'T_CR_CurrencyScheme', 'column', 'FRateFormula'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'0所有类型
1仅个别报表、抵消表
2仅调整报表
3调整报表优先',
'user', @CurrentUser, 'table', 'T_CR_CurrencyScheme', 'column', 'FTransRptType'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'Z暂存，A创建，B审核中，C已审核，D重新审核',
'user', @CurrentUser, 'table', 'T_CR_CurrencyScheme', 'column', 'FDocumentStatus'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'A否，B是',
'user', @CurrentUser, 'table', 'T_CR_CurrencyScheme', 'column', 'FCANCELSTATUS'
go
/*==============================================================*/
/* Index: IDX_CR_CurrScheme_FNumber */
/*==============================================================*/
create index IDX_CR_CurrScheme_FNumber on T_CR_CurrencyScheme (
FBillNo ASC
)
go
/*==============================================================*/
/* Index: IDX_CR_CurrScheme_CREATEDATE */
/*==============================================================*/
create index IDX_CR_CurrScheme_CREATEDATE on T_CR_CurrencyScheme (
FCreateDate ASC
)
go

### T_CR_CurrencyScheme(外币折算方案)：键值定义

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

### T_CR_CurrencyScheme(外币折算方案)：索引定义

名称 | 代码 | 唯一的 | 群集器 | 主要的 | 外键 | 候选键 | 表格
IDX_CR_CurrScheme_FNumber | IDX_CR_CurrScheme_FNumber | FALSE | FALSE | FALSE | FALSE | FALSE | T_CR_CurrencyScheme(外币折算方案)
IDX_CR_CurrScheme_CREATEDATE | IDX_CR_CurrScheme_CREATEDATE | FALSE | FALSE | FALSE | FALSE | FALSE | T_CR_CurrencyScheme(外币折算方案)

上一页

主页

下一页