/**Begin D:\PDM_UPGRADE\PDM1\POM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_XMFSTOCKCHANGELOG') 
 CREATE TABLE T_POM_XMFSTOCKCHANGELOG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(50) 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,
FSTOCKNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTOCKENTRYSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCHANGENO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTOCKID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTOCKENTRYID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREASON NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTOCKCHANGEID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTOCKCHANGEENTRYSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTOCKCHANGEENTRYID NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_STOCKCHGLOGDETAIL') 
 CREATE TABLE T_POM_STOCKCHGLOGDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTRYCHANGETYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FQTYTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERATIO DECIMAL(10,2) DEFAULT 0 NOT NULL,
FQTYNUMERATOR NVARCHAR(50) DEFAULT ' ' NOT NULL,
FQTYDENOMINATOR NVARCHAR(50) DEFAULT ' ' NOT NULL,
FWASTAGERATEFORMULA NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFIXSCRAP NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCRAPRATE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTANDQTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDEMANDQTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FUNISSUEQTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FUSEQTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FWIPQTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCANSENDQTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUPPLYMODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUPPLIERID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUPPLYORGID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FWAREHOUSEID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FLOCATION NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOUTORGUNITID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOUTWAREHOUSEID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOUTLOCATION NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISSUEMODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISBACKFLUSH NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISBULKMATERIAL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISKEYPART NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOVERISSUECONTRL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISSINHIGHLIMIT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXTRARATIOQTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISSINLOWLIMIT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FLACKRAITIOQTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDEMANDDATE NVARCHAR(50) DEFAULT ' ' NOT NULL
);



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