-- 修复本年累计折旧 t_fa_rs_yaccudepre
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_RS_YACCUDEPRE')
CREATE TABLE T_FA_RS_YACCUDEPRE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT 'A' NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FDEPREUSEID BIGINT DEFAULT 0 NOT NULL,
FBIZPERIODID BIGINT DEFAULT 0 NOT NULL,
FBIGINTFIELD BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBFYEARDEPRE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYEARDEPREADJUST DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME
);

EXEC P_ALTERPK 'PK_T_FA_RS_YACCUDEPRE', 'T_FA_RS_YACCUDEPRE', 'FID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_RS_YACCUDEPRE' AND KSQL_INDNAME = 'IDX_FA_YACCUDEPRE_FINID') CREATE INDEX IDX_FA_YACCUDEPRE_FINID ON T_FA_RS_YACCUDEPRE ( FBIGINTFIELD );

