/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_UNBANKDETAIL') 
 CREATE TABLE T_CAS_UNBANKDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FVOUCHERTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FVOUCHERNUMBER NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FBILLTYPE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLNUMBER NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FSETTLETYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSETTLENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBOOKDATE DATETIME,
FBIZDATE DATETIME,
FDEBITAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FCREDITAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FBANKBILLID BIGINT DEFAULT 0 NOT NULL,
FBANKSOURCETYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPDDATE DATETIME,
FAVDDATE DATETIME,
FPREPARATIONDATE DATETIME,
FSYSDATE DATETIME,
FBANKSOURCE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCASHIER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFEEPAYER NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_UNCOMPANYDETAIL') 
 CREATE TABLE T_CAS_UNCOMPANYDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSETTLETYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSETTLENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLID BIGINT DEFAULT 0 NOT NULL,
FSOURCETYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZDATE DATETIME,
FDEBITAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FCREDITAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FRATESDATE DATETIME,
FBANKVOUVHERNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTRADENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBALANCEAMT DECIMAL(19,6) DEFAULT 0 NOT NULL
);
/**End D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
