/**Begin D:\PDM_UPGRADE\PDM1\IFM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_TRANSHANDLE_E' AND KSQL_COL_NAME IN ('FPACCOUNTBANKID')) 
 ALTER TABLE T_IFM_TRANSHANDLE_E ADD (FPACCOUNTBANKID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_TRANSHANDLE_E' AND KSQL_COL_NAME IN ('FSOURCEBILLENTRYID')) 
 ALTER TABLE T_IFM_TRANSHANDLE_E ADD (FSOURCEBILLENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IFM_RECTRANSBILL') 
 CREATE TABLE T_IFM_RECTRANSBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FAUDITDATE DATETIME,
FSOURCEBILLTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSOURCEBILLID BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSCORGID BIGINT DEFAULT 0 NOT NULL,
FTRANSTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBIZDATE DATETIME,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FPAYEEORGID BIGINT DEFAULT 0 NOT NULL,
FPAYEEBANKID BIGINT DEFAULT 0 NOT NULL,
FPAYEEACCTBANKID BIGINT DEFAULT 0 NOT NULL,
FACTRECAMT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FPACCOUNTBANKID BIGINT DEFAULT 0 NOT NULL,
FPAYERNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPAYERBANKACCNUM NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPAYERBANKID BIGINT DEFAULT 0 NOT NULL,
FPAYERBANKNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPAYERTYPEID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FPAYERID BIGINT DEFAULT 0 NOT NULL,
FPAYERFORMID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FPAYERACCFORMID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FPAYERACCTBANKID BIGINT DEFAULT 0 NOT NULL,
FITEMPAYERTYPEID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FITEMPAYERID BIGINT DEFAULT 0 NOT NULL,
FPAYERNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSETTLETYPEID BIGINT DEFAULT 0 NOT NULL,
FSETTLENUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FOPENORGID BIGINT DEFAULT 0 NOT NULL,
FPAYEEDATE DATETIME,
FISVOUCHER CHAR(1) DEFAULT '0' NOT NULL,
FVOUCHERNUM NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBANKCHECKFLAG NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPAIDSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FACTTRADEDATE DATETIME,
FSOURCEBILLENTRYID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\IFM_table.sql **/
