/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_COSTCOLSMAPENTRY') 
 CREATE TABLE T_IM_COSTCOLSMAPENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCOSTRECORDFIELD NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCOSTRECORDFIELDKEY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FIMBILLFIELD NVARCHAR(100) DEFAULT ' ' NOT NULL,
FIMBILLFIELDKEY NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_COSTPRICECONF') 
 CREATE TABLE T_IM_COSTPRICECONF (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FIMBILL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLENTRY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLENTRYKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATION NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATIONNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FISPRESET CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FFILTERFORMULA NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFILTERFORMULA_TAG NCLOB,
FFILTERJSON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFILTERJSON_TAG NCLOB,
FISCOSTMAINACCOUNT CHAR(1) DEFAULT '0' NOT NULL,
FCOSTACCOUNT BIGINT DEFAULT 0 NOT NULL,
FACCOUNTTYPE BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_COSTPRICECONF_L') 
 CREATE TABLE T_IM_COSTPRICECONF_L (
FPKID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);



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