IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_DAILYREIMPAYENTRY')
 CREATE TABLE T_ER_DAILYREIMPAYENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTARGETBILLID BIGINT DEFAULT 0 NOT NULL,
FTARGETBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FTARGETBIZDATE DATETIME,
FTARGETPAYDATE DATETIME,
FTARGETPAYORG BIGINT DEFAULT 0 NOT NULL,
FTARGETOPENORG BIGINT DEFAULT 0 NOT NULL,
FTARGETPAYACCT VARCHAR(50) DEFAULT ' ' NOT NULL,
FTARGETPAYBANK BIGINT DEFAULT 0 NOT NULL,
FTARGETCURRENCY BIGINT DEFAULT 0 NOT NULL,
FTARGETEXCHANGE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETPAYAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETLOCALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETENTRUSTORG DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_LOANBILLPAYENTRY')
 CREATE TABLE T_ER_LOANBILLPAYENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTARGETBILLID BIGINT DEFAULT 0 NOT NULL,
FTARGETBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FTARGETBIZDATE DATETIME,
FTARGETPAYDATE DATETIME,
FTARGETPAYORG BIGINT DEFAULT 0 NOT NULL,
FTARGETOPENORG BIGINT DEFAULT 0 NOT NULL,
FTARGETPAYACCT VARCHAR(50) DEFAULT ' ' NOT NULL,
FTARGETPAYBANK BIGINT DEFAULT 0 NOT NULL,
FTARGETCURRENCY BIGINT DEFAULT 0 NOT NULL,
FTARGETEXCHANGE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETPAYAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETLOCALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETENTRUSTORG DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_PUBLICREIMPAYENTRY')
 CREATE TABLE T_ER_PUBLICREIMPAYENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTARGETBILLID BIGINT DEFAULT 0 NOT NULL,
FTARGETBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FTARGETBIZDATE DATETIME,
FTARGETPAYDATE DATETIME,
FTARGETPAYORG BIGINT DEFAULT 0 NOT NULL,
FTARGETOPENORG BIGINT DEFAULT 0 NOT NULL,
FTARGETPAYACCT VARCHAR(50) DEFAULT ' ' NOT NULL,
FTARGETPAYBANK BIGINT DEFAULT 0 NOT NULL,
FTARGETCURRENCY BIGINT DEFAULT 0 NOT NULL,
FTARGETEXCHANGE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETPAYAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETLOCALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETENTRUSTORG DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_TRIPREIMPAYENTRY')
 CREATE TABLE T_ER_TRIPREIMPAYENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTARGETBILLID BIGINT DEFAULT 0 NOT NULL,
FTARGETBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FTARGETBIZDATE DATETIME,
FTARGETPAYDATE DATETIME,
FTARGETPAYORG BIGINT DEFAULT 0 NOT NULL,
FTARGETOPENORG BIGINT DEFAULT 0 NOT NULL,
FTARGETPAYACCT VARCHAR(50) DEFAULT ' ' NOT NULL,
FTARGETPAYBANK BIGINT DEFAULT 0 NOT NULL,
FTARGETCURRENCY BIGINT DEFAULT 0 NOT NULL,
FTARGETEXCHANGE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETPAYAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETLOCALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETENTRUSTORG DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_TRIPREQPAYENTRY')
 CREATE TABLE T_ER_TRIPREQPAYENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTARGETBILLID BIGINT DEFAULT 0 NOT NULL,
FTARGETBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FTARGETBIZDATE DATETIME,
FTARGETPAYDATE DATETIME,
FTARGETPAYORG BIGINT DEFAULT 0 NOT NULL,
FTARGETOPENORG BIGINT DEFAULT 0 NOT NULL,
FTARGETPAYACCT VARCHAR(50) DEFAULT ' ' NOT NULL,
FTARGETPAYBANK BIGINT DEFAULT 0 NOT NULL,
FTARGETCURRENCY BIGINT DEFAULT 0 NOT NULL,
FTARGETEXCHANGE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETPAYAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETLOCALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTARGETENTRUSTORG DECIMAL(23,10) DEFAULT 0 NOT NULL
);
