/**Begin D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIM_REDINFO_WF') 
 CREATE TABLE T_SIM_REDINFO_WF (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FAPPLYDATE DATETIME,
FAPPLYNUM BIGINT DEFAULT 0 NOT NULL,
FALLFTOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FALLTOTALTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FALLTOTALPRICEANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAPPLYREASON NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPLYER BIGINT DEFAULT 0 NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FBILLSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREBACKREASON NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIM_REDINFO_WF_ITEM') 
 CREATE TABLE T_SIM_REDINFO_WF_ITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINFOSERIALNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPLICANT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSALERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSALERTAXNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBUYERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBUYERTAXNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICETYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FHSBZ NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDECIMALFIELD DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORIGINALINVOICECODE NVARCHAR(20) DEFAULT ' ' NOT NULL,
FORIGINALINVOICENO NVARCHAR(20) DEFAULT ' ' NOT NULL,
FORIGINALISSUETIME DATETIME,
FINFOSOURCE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREMAINREDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);



/**End D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_table.sql **/
