/**Begin D:\PDM\PDM_UPGRADE\pdm_new\FA_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETBOOK' AND KSQL_COL_NAME ='FMXCLOSEPERIODID') 
 ALTER TABLE T_FA_ASSETBOOK ADD (FMXCLOSEPERIODID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETBOOK' AND KSQL_COL_NAME ='FAUTOCLOSE') 
 ALTER TABLE T_FA_ASSETBOOK ADD (FAUTOCLOSE CHAR(1) DEFAULT '1' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETBOOK' AND KSQL_COL_NAME ='FAUTOOPEN') 
 ALTER TABLE T_FA_ASSETBOOK ADD (FAUTOOPEN CHAR(1) DEFAULT '1' );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_CLOSINGCHECKITEM_L') 
 CREATE TABLE T_FA_CLOSINGCHECKITEM_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDISCRIPTION NVARCHAR(255) DEFAULT ' ',
FNOTE NVARCHAR(255) DEFAULT ' '
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_CLOSINGCHECKITEM') 
 CREATE TABLE T_FA_CLOSINGCHECKITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORG BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX BIGINT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX BIGINT DEFAULT 0 NOT NULL,
FSRCCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FDISCRIPTION NVARCHAR(255) DEFAULT ' ',
FCHECKCONDITIONEXPRBTN NVARCHAR(1000) DEFAULT ' ',
FNOTE NVARCHAR(255) DEFAULT ' ',
FCONDITION NVARCHAR(255) DEFAULT ' ',
FCONDITION_TAG NCLOB DEFAULT ' ',
FBIZOBJECT VARCHAR(36) DEFAULT ' ' NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FCHECKMETHOD CHAR(1) DEFAULT 'c' NOT NULL
);


/**End D:\PDM\PDM_UPGRADE\pdm_new\FA_table.sql **/
