/**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_TRANSDETAIL') 
 CREATE TABLE T_BEI_TRANSDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBIZDATE DATETIME,
FBIZTIME DATETIME,
FSRCBILLTYPE SMALLINT DEFAULT 0 NOT NULL,
FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBIZTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FDEBITAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FCREDITAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FTRANSBALANCE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBANKACCOUNTID BIGINT DEFAULT 0 NOT NULL,
FOPPUNIT NVARCHAR(100) DEFAULT ' ' NOT NULL,
FOPPBANKNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FOPPBANK NVARCHAR(100) DEFAULT ' ' NOT NULL,
FISTRANSUP CHAR(1) DEFAULT '0' NOT NULL,
FISTRANSDOWN CHAR(1) DEFAULT '0' NOT NULL,
FISRECED CHAR(1) DEFAULT '0' NOT NULL,
FISBANKWITHHOLDING CHAR(1) DEFAULT '0' NOT NULL,
FISKDRETFLAG CHAR(1) DEFAULT '0' NOT NULL,
FRECEDBILLTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FRECEDBILLNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FISMATCHERECEIPT CHAR(1) DEFAULT '0' NOT NULL,
FBANKCHECKFLAG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBANKINTERFACETYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FISDEBIT CHAR(1) DEFAULT '0' NOT NULL,
FRECEREDTYPE VARCHAR(5) DEFAULT ' ' NOT NULL,
FSTATE SMALLINT DEFAULT 0 NOT NULL,
FRECDATE DATETIME,
FLINENO INT DEFAULT 0 NOT NULL,
FOPPCOMPANYID BIGINT DEFAULT 0 NOT NULL,
FRAWTRANSTIME DATETIME,
FISFAKEDETAIL CHAR(1) DEFAULT '0' NOT NULL,
FTRANPACKAGEID NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBANKINTERFACEID BIGINT DEFAULT 0 NOT NULL,
FBANKINTERFACE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBANKLOG BIGINT DEFAULT 0 NOT NULL,
FHASREFUNDPAY CHAR(1) DEFAULT '0' NOT NULL,
FCREATETIME DATETIME,
FISREFUND CHAR(1) DEFAULT '0' NOT NULL,
FORIGINALBANKCHECKFLAG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBIZREFNO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_TRANSDETAIL_E') 
 CREATE TABLE T_BEI_TRANSDETAIL_E (
FID BIGINT DEFAULT 0 NOT NULL,
FISDOWNTOBANKSTATE CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFYTIME DATETIME,
FAUDITDATE DATETIME,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FISNORECEIPT CHAR(1) DEFAULT '0' NOT NULL,
FRECEIPTNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FDATASOURCES CHAR(1) DEFAULT '0' NOT NULL,
FISDATAIMPORT CHAR(1) DEFAULT '0' NOT NULL,
FBANKRST NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISCREATEDTRANSUP CHAR(1) DEFAULT '0' NOT NULL,
FISCREATEDTRANSDOWN CHAR(1) DEFAULT '0' NOT NULL,
FAGENTACCNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FAGENTACCNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FAGENTACCBKNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_BANKBALANCE') 
 CREATE TABLE T_BEI_BANKBALANCE (
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,
FBANKACCOUNTID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FBASECURRENCYID BIGINT DEFAULT 0 NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCURRENTBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAVAILABLEBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLASTDAYBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUPDATETIME DATETIME,
FISUPDATE CHAR(1) DEFAULT '0' NOT NULL,
FVIEWDATE VARCHAR(100) DEFAULT ' ' NOT NULL,
FLOGO VARCHAR(100) DEFAULT ' ' NOT NULL,
FDATASOURCES CHAR(1) DEFAULT '0' NOT NULL,
FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL,
FABSTRACT NVARCHAR(255) DEFAULT ' ' NOT NULL
);



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