/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AP_table.sql **/
-- 脚本名称加一个_t，独立于pdm生成的脚本，这个文件要以前发布，避免后续内容无法执行
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AP_EASSETTLERECORD')
 CREATE TABLE T_AP_EASSETTLERECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FISSAMECURRENCY CHAR(1) DEFAULT '0' NOT NULL,
FISFROMAR CHAR(1) DEFAULT '0' NOT NULL,
FSETTLEDATE DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL,
FXHRECORDSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FFAILMESSAGE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFAILMESSAGE_TAG NCLOB,
FORIGINTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSETTLERELATION VARCHAR(30) DEFAULT ' ' NOT NULL,
FISREVERSEBILL CHAR(1) DEFAULT '0' NOT NULL,
FISREVERSED CHAR(1) DEFAULT '0' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FSRCSYSBILLID VARCHAR(100) DEFAULT ' ' NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_AP_EASSETTLERECORDENTRY') 
 CREATE TABLE T_AP_EASSETTLERECORDENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBILLID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSETTLEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSETTLEAMTLOCAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSWAPPL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBILLENTITY VARCHAR(30) DEFAULT ' ' NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBILLENTRYID BIGINT DEFAULT 0 NOT NULL,
FEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISMAIN CHAR(1) DEFAULT '0' NOT NULL,
FSRCSYSBILLENTRYID VARCHAR(100) DEFAULT ' ' NOT NULL
);



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