/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_TAX_ACCE_DIFF') 
 CREATE TABLE T_TCCIT_TAX_ACCE_DIFF (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(30) DEFAULT ' ' 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,
FORGID BIGINT DEFAULT 0 NOT NULL,
FASSERTNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FASSERTNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FASSERTVALUE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPERIOD DATETIME,
FCURRENTACCOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYEARACCOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALACCOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCURRENTTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYEARTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCURRENTACCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYEARACCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALACCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCURRENTDIFF DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYEARDIFF DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALDIFF DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DEPRECIATE_ACCOUN') 
 CREATE TABLE T_TCCIT_DEPRECIATE_ACCOUN (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(30) DEFAULT ' ' NOT NULL,
FBIZNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATATYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FFCONDITIONJSON NCLOB,
FFILTERCONDITION NCLOB,
FAMOUNTFIELD BIGINT DEFAULT 0 NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DEPRECIATE_NORMAL') 
 CREATE TABLE T_TCCIT_DEPRECIATE_NORMAL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FBIZNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FAMOUNTFIELD BIGINT DEFAULT 0 NOT NULL,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL,
FDATATYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FDATADIRECTION VARCHAR(30) DEFAULT ' ' NOT NULL,
FFILTERCONDITION NCLOB,
FFCONDITIONJSON NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DEPRECIATE_QUICK') 
 CREATE TABLE T_TCCIT_DEPRECIATE_QUICK (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FBIZNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FAMOUNTFIELD BIGINT DEFAULT 0 NOT NULL,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL,
FDATATYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FDATADIRECTION VARCHAR(30) DEFAULT ' ' NOT NULL,
FFILTERCONDITION NCLOB,
FFCONDITIONJSON NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DEPRECIATE_RULE') 
 CREATE TABLE T_TCCIT_DEPRECIATE_RULE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FRULETYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FDEPRECIATETYPEID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_ASSERT_ACCE_DEPRE' AND KSQL_COL_NAME ='FSKSSQQ') 
 ALTER TABLE T_TCCIT_ASSERT_ACCE_DEPRE ADD (FSKSSQQ DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_ASSERT_ACCE_DEPRE' AND KSQL_COL_NAME ='FSKSSQZ') 
 ALTER TABLE T_TCCIT_ASSERT_ACCE_DEPRE ADD (FSKSSQZ DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_ASSERT_ACCE_TOTAL' AND KSQL_COL_NAME ='FBNTOTALZZDEPRE') 
 ALTER TABLE T_TCCIT_ASSERT_ACCE_TOTAL ADD (FBNTOTALZZDEPRE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_ASSERT_ACCE_TOTAL' AND KSQL_COL_NAME ='FBNTOTALSFDEPRE') 
 ALTER TABLE T_TCCIT_ASSERT_ACCE_TOTAL ADD (FBNTOTALSFDEPRE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_ASSERT_ACCE_TOTAL' AND KSQL_COL_NAME ='FBNTOTALJSDEPRE') 
 ALTER TABLE T_TCCIT_ASSERT_ACCE_TOTAL ADD (FBNTOTALJSDEPRE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_ASSERT_ACCE_TOTAL' AND KSQL_COL_NAME ='FTAXLIMIT') 
 ALTER TABLE T_TCCIT_ASSERT_ACCE_TOTAL ADD (FTAXLIMIT VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_ASSERT_ACCE_TOTAL' AND KSQL_COL_NAME ='FRULEID') 
 ALTER TABLE T_TCCIT_ASSERT_ACCE_TOTAL ADD (FRULEID BIGINT DEFAULT 0 NOT NULL );

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