/**Begin D:\PDM_UPGRADE\PDM1\Physical Data _1_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_ASSETSPLITBILL') 
 CREATE TABLE T_FA_ASSETSPLITBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FREALCARDID BIGINT DEFAULT 0 NOT NULL,
FSPLITQTY BIGINT DEFAULT 0 NOT NULL,
FSPLITTYPE VARCHAR(50) DEFAULT 'A' NOT NULL,
FBIZDATE DATETIME,
FAPPLIANTID BIGINT DEFAULT 0 NOT NULL,
FSPLITPERIOD BIGINT DEFAULT 0 NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT 'A' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FAUDITDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_ASSETSPLITENTRY') 
 CREATE TABLE T_FA_ASSETSPLITENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FREALCARDID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FFINCARDID BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FPARTCLEARDEPRE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMONTHDEPRECHG DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMONTHDEPRE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FYEARORIGVALCHG DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMONTHORIGVALCHG DECIMAL(19,6) DEFAULT 0 NOT NULL,
FINCOMETAX DECIMAL(19,6) DEFAULT 0 NOT NULL,
FORIGINALAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNETAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNETWORTH DECIMAL(19,6) DEFAULT 0 NOT NULL,
FPRERESIDUALVAL DECIMAL(19,6) DEFAULT 0 NOT NULL,
FDECVAL DECIMAL(19,6) DEFAULT 0 NOT NULL,
FADDUPYEARDEPRE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FACCUMDEPRE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FORIGINALVAL DECIMAL(19,6) DEFAULT 0 NOT NULL,
FASSETAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FBAKREALCARDID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_ASSETSPLITENTRY_D') 
 CREATE TABLE T_FA_ASSETSPLITENTRY_D (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCARDBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCARDNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FREALCARDID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FFINCARDID BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FPARTCLEARDEPRE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMONTHDEPRECHG DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMONTHDEPRE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FYEARORIGVALCHG DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMONTHORIGVALCHG DECIMAL(19,6) DEFAULT 0 NOT NULL,
FINCOMETAX DECIMAL(19,6) DEFAULT 0 NOT NULL,
FORIGINALAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNETAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNETWORTH DECIMAL(19,6) DEFAULT 0 NOT NULL,
FPRERESIDUALVAL DECIMAL(19,6) DEFAULT 0 NOT NULL,
FDECVAL DECIMAL(19,6) DEFAULT 0 NOT NULL,
FADDUPYEARDEPRE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FACCUMDEPRE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FORIGINALVAL DECIMAL(19,6) DEFAULT 0 NOT NULL,
FASSETAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\Physical Data _1_table.sql **/
