/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AR_GLIMPORTBILL') 
 CREATE TABLE T_AR_GLIMPORTBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(30) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FACCOUNTID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AR_GLIMPORTSCHEME') 
 CREATE TABLE T_AR_GLIMPORTSCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX BIGINT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX BIGINT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(30) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AR_GLIMPORTSCHEMEENTRY') 
 CREATE TABLE T_AR_GLIMPORTSCHEMEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FACCOUNTID BIGINT DEFAULT 0 NOT NULL,
FBALANCETYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FASSTACTITEMID BIGINT DEFAULT 0 NOT NULL,
FENTITYOBJECT VARCHAR(50) DEFAULT ' ' NOT NULL,
FBALANCEDC VARCHAR(5) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBIZTYPEID BIGINT DEFAULT 0 NOT NULL,
FASSTACTTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FPAYMENTTYPEID BIGINT DEFAULT 0 NOT NULL,
FRECTYPEID BIGINT DEFAULT 0 NOT NULL,
FAPPAYPROPERTYID BIGINT DEFAULT 0 NOT NULL,
FARPAYPROPERTYID BIGINT DEFAULT 0 NOT NULL,
FLINETYPEID BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FEXPENSEITEMID BIGINT DEFAULT 0 NOT NULL,
FASSTACTITEMID1 BIGINT DEFAULT 0 NOT NULL,
FMAPPINGFIELD1 VARCHAR(50) DEFAULT ' ' NOT NULL,
FMAPPINGFIELDNAME1 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FASSTACTITEMID2 BIGINT DEFAULT 0 NOT NULL,
FMAPPINGFIELD2 VARCHAR(50) DEFAULT ' ' NOT NULL,
FMAPPINGFIELDNAME2 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FASSTACTITEMID3 BIGINT DEFAULT 0 NOT NULL,
FMAPPINGFIELD3 VARCHAR(50) DEFAULT ' ' NOT NULL,
FMAPPINGFIELDNAME3 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FASSTACTITEMID4 BIGINT DEFAULT 0 NOT NULL,
FMAPPINGFIELD4 VARCHAR(50) DEFAULT ' ' NOT NULL,
FMAPPINGFIELDNAME4 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FASSTACTITEMID5 BIGINT DEFAULT 0 NOT NULL,
FMAPPINGFIELD5 VARCHAR(50) DEFAULT ' ' NOT NULL,
FMAPPINGFIELDNAME5 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FASSTACTITEMID6 BIGINT DEFAULT 0 NOT NULL,
FMAPPINGFIELD6 VARCHAR(50) DEFAULT ' ' NOT NULL,
FMAPPINGFIELDNAME6 NVARCHAR(100) DEFAULT ' ' NOT NULL
);


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



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