/**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_RECONCILIATION_SUM') 
 CREATE TABLE T_SIM_RECONCILIATION_SUM (
FID BIGINT DEFAULT 0 NOT NULL,
FORIGINALID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORIGTOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORIGINVOICEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORIGTOTALTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALAMOUNTDIFFER DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICEAMOUNTDIFFER DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICETYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FBUYERNAME VARCHAR(150) DEFAULT ' ' NOT NULL,
FTOTALTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FTOTALTAXDIFFER DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIM_RECONCILIATION_ITEM') 
 CREATE TABLE T_SIM_RECONCILIATION_ITEM (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FINVOICENO VARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICECODE VARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICETYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FINVOICESTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FINVOICEID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FISSUETIME DATETIME
);



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