/**Begin D:\tool\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm1\RIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_AUTO_DEDUCTION_TASK') 
 CREATE TABLE T_RIM_AUTO_DEDUCTION_TASK (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX BIGINT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX BIGINT DEFAULT 0 NOT NULL,
FDEDUCTION_PURPOSE VARCHAR(50) DEFAULT ' ' NOT NULL,
FACCOUNTINGORGID BIGINT DEFAULT 0 NOT NULL,
FTAXNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICERESOUCE VARCHAR(50) DEFAULT ' ' NOT NULL,
FRECEIPTTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPRETICK VARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOVICESTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FDEDUCTCONFIG VARCHAR(50) DEFAULT ' ' NOT NULL,
FTAX_BURDEN_RATE DECIMAL(23,2) DEFAULT 0 NOT NULL,
FBEGIN_PERIOD_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCURRENT_PERIOD_TAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCURRENT_PERIOD_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINPUT_OUT_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEXIT_RETURN_TAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINPUT_TAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDEDUCTCONFIGTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FEXCUTETIME VARCHAR(50) DEFAULT ' ' NOT NULL,
FTICK VARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICETYPE VARCHAR(50) DEFAULT ' ' NOT NULL
);

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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_AUTO_DEDUCTION_TASK_L') 
 CREATE TABLE T_RIM_AUTO_DEDUCTION_TASK_L (
FID BIGINT DEFAULT 0 NOT NULL,
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);

/**End D:\tool\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm1\RIM_table.sql **/
