/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_SUPINVALIDENTRY') 
 CREATE TABLE T_SRC_SUPINVALIDENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FLINKMAN NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPHONE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISINVITE CHAR(1) DEFAULT '0' NOT NULL,
FFEEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISPAYFEE CHAR(1) DEFAULT '0' NOT NULL,
FISCONFIRM CHAR(1) DEFAULT '0' NOT NULL,
FISABANDON CHAR(1) DEFAULT '0' NOT NULL,
FISTENDER CHAR(1) DEFAULT '0' NOT NULL,
FISNEGOTIATE CHAR(1) DEFAULT '0' NOT NULL,
FISDISCARD CHAR(1) DEFAULT '0' NOT NULL,
FREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTRYSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FABANDONREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISQUOTE CHAR(1) DEFAULT '0' NOT NULL,
FSRCENTRYID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_SUPPLIERINVALID') 
 CREATE TABLE T_SRC_SUPPLIERINVALID (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER_TEMP' AND KSQL_COL_NAME ='FREASON') 
 ALTER TABLE T_SRC_INVITESUPPLIER_TEMP ADD (FREASON NVARCHAR(100) DEFAULT ' ' NOT NULL );

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