/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BEI_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_BANKAGENTPAYBILL_L') 
 CREATE TABLE T_BEI_BANKAGENTPAYBILL_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_BANKAGENTPAYENTRY') 
 CREATE TABLE T_BEI_BANKAGENTPAYENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FRECNAME VARCHAR(50) DEFAULT '1' NOT NULL,
FRECBANK VARCHAR(50) DEFAULT '1' NOT NULL,
FACCTBANKNUM VARCHAR(50) DEFAULT '1' NOT NULL,
FAMOUNT VARCHAR(100) DEFAULT '1' NOT NULL,
FPROVINCE VARCHAR(50) DEFAULT '1' NOT NULL,
FCITY VARCHAR(50) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT '1' NOT NULL,
FBANKRETURNMSG VARCHAR(200) DEFAULT '1' NOT NULL,
FISREFUND CHAR(1) DEFAULT '1' NOT NULL,
FISAGENCYPERSONPAY CHAR(1) DEFAULT '1' NOT NULL,
FREMARK VARCHAR(200) DEFAULT '1' NOT NULL,
FBANKCHECKFLAG VARCHAR(80) DEFAULT '1' NOT NULL,
FSOURCEENTRYID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_BANKPAYINGBILL_L') 
 CREATE TABLE T_BEI_BANKPAYINGBILL_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_BANKAGENTPAYBILL') 
 CREATE TABLE T_BEI_BANKAGENTPAYBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FAUDITDATE DATETIME,
FCOMPANYID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBIZDATE DATETIME,
FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FLOCAMT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FACCOUNTBANKID BIGINT DEFAULT 0 NOT NULL,
FBANKID BIGINT DEFAULT 0 NOT NULL,
FAGENTPAYBILLNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FCOUNT BIGINT DEFAULT 0 NOT NULL,
FACTCOUNT BIGINT DEFAULT 0 NOT NULL,
FACTAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FEXPECTDEALTIME DATETIME,
FISBITBACK CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_BANKPAYINGBILL') 
 CREATE TABLE T_BEI_BANKPAYINGBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FAUDITDATE DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBIZDATE DATETIME,
FEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBANKID BIGINT DEFAULT 0 NOT NULL,
FACCOUNTBANKID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FLOCAMT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSRCBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FPAYAPPLYORGNM NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBANKRETURNMSG NVARCHAR(255),
FISBITBACK CHAR(1) DEFAULT ' ' NOT NULL,
FSUBMITTIME DATETIME,
FPAYERACCTBANKID BIGINT DEFAULT 0 NOT NULL,
FPAYAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FUSAGE NVARCHAR(255),
FPAYEENAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FPAYEEBANKNUM NVARCHAR(80) DEFAULT ' ' NOT NULL,
FPAYEEBANKNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FRECBANKNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FRECCOUNTRYID BIGINT DEFAULT 0 NOT NULL,
FRECPROVINCE NVARCHAR(80) DEFAULT ' ' NOT NULL,
FRECCITY NVARCHAR(80) DEFAULT ' ' NOT NULL,
FEXPECTDEALTIME DATETIME,
FSTATEMENTREFNO VARCHAR(80) DEFAULT ' ' NOT NULL,
FSERIALNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FBITBACKERID BIGINT DEFAULT 0 NOT NULL,
FBITBACKTIME DATETIME,
FBATCHSEQID VARCHAR(80) DEFAULT ' ' NOT NULL,
FISREFUND CHAR(1) DEFAULT '0' NOT NULL,
FCOMPANYID BIGINT DEFAULT 0 NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\BEI_table.sql **/
