/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_KDINVOICECTRLCFG_L') 
 CREATE TABLE T_ER_KDINVOICECTRLCFG_L (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_KDINVOICECTRLCFG') 
 CREATE TABLE T_ER_KDINVOICECTRLCFG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FTAXREGNUM VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIRMNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FCLIENT_ID VARCHAR(50) DEFAULT ' ' NOT NULL,
FCLIENTS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCLIENTKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FREIMED_CI CHAR(1) DEFAULT '0' NOT NULL,
FNAMENOTMATCH_CI CHAR(1) DEFAULT '0' NOT NULL,
FTAXNUMNOTMATCH_CI CHAR(1) DEFAULT '0' NOT NULL,
FBUYERNAMELE5_CI CHAR(1) DEFAULT '0' NOT NULL,
FCHECKNOTPASS_CI CHAR(1) DEFAULT '0' NOT NULL,
FSYNC CHAR(1) DEFAULT '0' NOT NULL
);