/**Begin D:\PDM_UPGRADE\PDM1\kd_1.5.112_tbo_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TBO_PLCONFIG') 
 CREATE TABLE T_TBO_PLCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FENABLE NVARCHAR(30) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TBO_PLCONFIG_ENTRYS') 
 CREATE TABLE T_TBO_PLCONFIG_ENTRYS (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBIZTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FFOREXQUOTEID BIGINT DEFAULT 0 NOT NULL,
FPLCONFIGITEMID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TBO_PLCONFIG_ORG') 
 CREATE TABLE T_TBO_PLCONFIG_ORG (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TBO_PLCONFIGITEM') 
 CREATE TABLE T_TBO_PLCONFIGITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FENABLE NVARCHAR(30) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FBIZTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TBO_PLINFO') 
 CREATE TABLE T_TBO_PLINFO (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(30) 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,
FLOCALCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FSPLCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FSUMPLAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMPLLOCALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTRADEBILLID BIGINT DEFAULT 0 NOT NULL,
FTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FPLCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FFOREXQUOTEID BIGINT DEFAULT 0 NOT NULL,
FREFEREXRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCALFQID BIGINT DEFAULT 0 NOT NULL,
FLOCALFXQUOTE NVARCHAR(80) DEFAULT ' ' NOT NULL,
FLOCALEXRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFLOATPLAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFLOATPLLOCALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINFLOATPLAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINFLOATPLLOCALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLASTENTERDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TBO_PLINFO_ENTRYS') 
 CREATE TABLE T_TBO_PLINFO_ENTRYS (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBIZDATE DATETIME,
FSETTLEDATE DATETIME,
FBIZTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FPLAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPLLOCALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBIZBILLID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\kd_1.5.112_tbo_table.sql **/
