/**Begin D:\PDM_UPGRADE\PDM1\MAL_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MAL_ORDER_ZKH') 
 CREATE TABLE T_MAL_ORDER_ZKH (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FPORDERID VARCHAR(80) DEFAULT ' ' NOT NULL,
FORDERID VARCHAR(80) DEFAULT ' ' NOT NULL,
FSUBMITSTATE CHAR(1) DEFAULT ' ' NOT NULL,
FSTATE VARCHAR(2) DEFAULT ' ' NOT NULL,
FORDERSTATE CHAR(1) DEFAULT ' ' NOT NULL,
FFREIGHT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORDERAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORDERNAKEDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORDERTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICESTATE CHAR(1) DEFAULT ' ' NOT NULL,
FINVOICEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICECODE VARCHAR(80) DEFAULT ' ' NOT NULL,
FINVOICEDATE DATETIME,
FINVOICETAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICETAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICETAXRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICEADDRESS NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FMARKID NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINVOICETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FINVOICERESULT NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MAL_ORDERENTRY_ZKH') 
 CREATE TABLE T_MAL_ORDERENTRY_ZKH (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FGOODSID BIGINT DEFAULT 0 NOT NULL,
FQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNAKEDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAXRATE DECIMAL(23,10) DEFAULT 0 NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\MAL_table.sql **/
