/**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_INVQUERYCONF') 
 CREATE TABLE T_IM_INVQUERYCONF (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(50) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLOBJ NVARCHAR(36) DEFAULT ' ' NOT NULL,
FSRCBILLENTRY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCBILLENTRYNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FOPERATEKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(100) DEFAULT ' ' NOT NULL,
FISPRESET CHAR(1) DEFAULT '0' NOT NULL,
FRETURNTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDEALTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FQTYRULE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPROQTYFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FACTIONID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNEWDEAL CHAR(1) DEFAULT '1' NOT NULL,
FENTRYNOUPDATEFIELDKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPLUGINNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFILTERPLUGINNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FUNITTRAN CHAR(1) DEFAULT '0' NOT NULL,
FMIDDLEINSERT CHAR(1) DEFAULT '0' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_INVQUERYMAPPING') 
 CREATE TABLE T_IM_INVQUERYMAPPING (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINVACCCOLNO NVARCHAR(100) DEFAULT ' ' NOT NULL,
FINVACCCOL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSRCBILLCOLNO NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSRCBILLCOL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FQFILTER CHAR(1) DEFAULT '0' NOT NULL,
FUPDATE CHAR(1) DEFAULT '0' NOT NULL,
FMATCH CHAR(1) DEFAULT '0' NOT NULL,
FRETURNORDER BIGINT DEFAULT 0 NOT NULL
);



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