/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_NORMAL') 
 CREATE TABLE T_TCTB_TAX_VER_NORMAL (
FID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FVER BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_NORMAL_E') 
 CREATE TABLE T_TCTB_TAX_VER_NORMAL_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMODIFYCONTEXBEFORECODE VARCHAR(100) DEFAULT ' ' NOT NULL,
FMODIFYCONTEXAFTERCODE VARCHAR(100) DEFAULT ' ' NOT NULL,
FMODIFYCONTEXTTITLEYSJBS VARCHAR(100) DEFAULT ' ' NOT NULL,
FMODIFYCONTEXAFTER VARCHAR(500) DEFAULT ' ' NOT NULL,
FMODIFYCONTEXBEFORE VARCHAR(100) DEFAULT ' ' NOT NULL,
FMODIFYCONTEXTTITLE VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_XFS') 
 CREATE TABLE T_TCTB_TAX_VER_XFS (
FID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FVER BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_XFS_E') 
 CREATE TABLE T_TCTB_TAX_VER_XFS_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTAXRATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPERIOD VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FXFSTAXITEMRATE BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_YHS') 
 CREATE TABLE T_TCTB_TAX_VER_YHS (
FID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FVER BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_YHS_E') 
 CREATE TABLE T_TCTB_TAX_VER_YHS_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTAXRATEID BIGINT DEFAULT 0 NOT NULL,
FPERIOD VARCHAR(50) DEFAULT ' ' NOT NULL,
FISVERIFY CHAR(1) DEFAULT ' ' NOT NULL,
FHDRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEFFECTIVEDATE DATETIME,
FEXPIRYDATE DATETIME,
FENDDATE DATETIME,
FSTARTDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAXINFO_POINT_VER') 
 CREATE TABLE T_TCTB_TAXINFO_POINT_VER (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
