/**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_STATUS_BILL') 
 CREATE TABLE T_SIM_STATUS_BILL (
FID BIGINT DEFAULT 0 NOT NULL,
FSALERNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICETYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBLUEINVOICENUM BIGINT DEFAULT 0 NOT NULL,
FBLUETOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBLUETOTALTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREDINVOICENUM BIGINT DEFAULT 0 NOT NULL,
FREDTOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREDTOTALTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCANCELBLUENUM BIGINT DEFAULT 0 NOT NULL,
FCANCELBLUETOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCANCELBLUETOTALTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISSUEDEVICE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDATE DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIM_TAXRATE_BILL') 
 CREATE TABLE T_SIM_TAXRATE_BILL (
FID BIGINT DEFAULT 0 NOT NULL,
FSALERNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSALERTAXNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICETYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FDATE DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL,
FISSUEDEVICE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICENATURE NVARCHAR(30) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIM_TAXRATE_BILL_ITEM') 
 CREATE TABLE T_SIM_TAXRATE_BILL_ITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCOUNTDIMENSION NVARCHAR(30) DEFAULT ' ' NOT NULL,
FTOTAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTHIRTEENPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTENPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNINEPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSIXPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFIVEPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTHREEPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FONEPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FZEROPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FOTHERPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL
);



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