/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_OSWFRECORD') 
 CREATE TABLE T_IM_OSWFRECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FWFNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FWFSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FWRITEOFFTYPEID BIGINT DEFAULT 0 NOT NULL,
FSUPPLY BIGINT DEFAULT 0 NOT NULL,
FCURRENCYFIELD BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMAINCURRENCY BIGINT DEFAULT 0 NOT NULL,
FHEADWFINFO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FHEADWFINFO_TAG NCLOB,
FBILLSTATUS CHAR(1) DEFAULT 'C' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IM_OSWFRECORDENTRY') 
 CREATE TABLE T_IM_OSWFRECORDENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBILLTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLID BIGINT DEFAULT 0 NOT NULL,
FBILLENTRYID BIGINT DEFAULT 0 NOT NULL,
FBILLQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FVERIFYBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUNIT BIGINT DEFAULT 0 NOT NULL,
FASSTSRCBILLENTRYSEQ BIGINT DEFAULT 0 NOT NULL,
FASSTMATERIAL BIGINT DEFAULT 0 NOT NULL,
FASSTUNIT BIGINT DEFAULT 0 NOT NULL,
FASSTBASEWRITQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUNITFIELD BIGINT DEFAULT 0 NOT NULL,
FSRCBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCENTRYSEQ BIGINT DEFAULT 0 NOT NULL,
FDATEFIELD DATETIME,
FINVSCHEME BIGINT DEFAULT 0 NOT NULL,
FWFINFO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FWFINFO_TAG NCLOB
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
