/**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_COUNT_CHECK') 
 CREATE TABLE T_SIM_COUNT_CHECK (
FID BIGINT DEFAULT 0 NOT NULL,
FBUYERNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICEAMOUNTSUM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALAMOUNTSUM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALTAXSUM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALAMOUNTDIFFER DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICEAMOUNTDIFFER DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALTAXDIFFER DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FDATEFIELD DATETIME,
FINVOICECONFIRMS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINVOICECONFIRMS_TAG NCLOB,
FISSUESTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIM_COUNT_CHECK_ITEMS') 
 CREATE TABLE T_SIM_COUNT_CHECK_ITEMS (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FORIGTOTALAMOUNT BIGINT DEFAULT 0 NOT NULL,
FORIGINVOICEAMOUNT BIGINT DEFAULT 0 NOT NULL,
FORIGTOTALTAX BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL
);



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