/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_CALCDETAIL') 
 CREATE TABLE T_MRP_CALCDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FCACULATELOG BIGINT DEFAULT 0 NOT NULL,
FMRPPLAN BIGINT DEFAULT 0 NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_CALDETAILENTRY') 
 CREATE TABLE T_MRP_CALDETAILENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMATERIAL BIGINT DEFAULT 0 NOT NULL,
FSUPPLYQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDEMANDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDEMANDBILLTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLENTRYID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUPPLYBILLID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUPPLYBILLENTRYID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUPPLYBILLTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FADJUSTSUGGEST NVARCHAR(50) DEFAULT ' ' NOT NULL,
FADJUSTQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FADJUSTDATE DATETIME,
FBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLENTRYSEQ INT DEFAULT 0 NOT NULL,
FSUPPLYBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUPPLYBILLENTRYSEQ INT DEFAULT 0 NOT NULL,
FDEMANDDATE DATETIME,
FSUPPLYDATE DATETIME,
FMATERIALATTR INT DEFAULT 0 NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
