/**Begin D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIM_GIFT_RECEIPT') 
 CREATE TABLE T_SIM_GIFT_RECEIPT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FVALIDDATE INT DEFAULT 0 NOT NULL,
FBOTTOMREMARK NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTOPREMARK NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXPIRINGDATE DATETIME,
FJQBH VARCHAR(20) DEFAULT ' ' NOT NULL,
FINVOICETYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FHSBZ VARCHAR(10) DEFAULT ' ' NOT NULL,
FSALERNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSALERTAXNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FSALERADDR NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSALERBANK NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDRAWER NVARCHAR(16) DEFAULT ' ' NOT NULL,
FPAYEE NVARCHAR(16) DEFAULT ' ' NOT NULL,
FREVIEWER NVARCHAR(16) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBUYERPHONE VARCHAR(30) DEFAULT ' ' NOT NULL,
FINVOICECODE VARCHAR(20) DEFAULT ' ' NOT NULL,
FINVOICENO VARCHAR(20) DEFAULT ' ' NOT NULL,
FORDERNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FRECEIPTSTATE VARCHAR(20) DEFAULT ' ' NOT NULL,
FTOTALTAX DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIM_GIFT_RECEIPT_ITEM') 
 CREATE TABLE T_SIM_GIFT_RECEIPT_ITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMODIFIERFIELD BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATEFIELD DATETIME,
FGOODSNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSPECIFICATION NVARCHAR(40) DEFAULT ' ' NOT NULL,
FUNIT NVARCHAR(22) DEFAULT ' ' NOT NULL,
FNUM DECIMAL(26,13) DEFAULT 0 NOT NULL,
FTAXUNITPRICE DECIMAL(26,13) DEFAULT 0 NOT NULL,
FTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAXRATE VARCHAR(20) DEFAULT ' ' NOT NULL,
FTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FGOODSID BIGINT DEFAULT 0 NOT NULL,
FROWTYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FGOODSCODE VARCHAR(30) DEFAULT ' ' NOT NULL
);



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