/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_EBAPPROVEBILL') 
CREATE TABLE T_BCM_EBAPPROVEBILL (
FID                  BIGINT               NOT NULL DEFAULT 0,
FBILLNO              NVARCHAR(100)        NOT NULL DEFAULT ' ',
FEBORGMASTERID       BIGINT               NOT NULL DEFAULT 0,
FAPPROVEINFO         NVARCHAR(510)        NOT NULL DEFAULT ' ',
FBILLSTATUS          NVARCHAR(2)          NOT NULL DEFAULT '1',
FBILLTYPE            NVARCHAR(2)          NOT NULL DEFAULT '0',
FEBORGID             BIGINT               NOT NULL DEFAULT 0,
FAPPROVETEMPID       BIGINT               NOT NULL DEFAULT 0,
FMODELID             BIGINT               NOT NULL DEFAULT 0,
FDIMDATATYPE         BIGINT               NOT NULL DEFAULT 0,
FDIMYEAR             NVARCHAR(20)         NOT NULL DEFAULT ' ',
FDIMPERIOD           NVARCHAR(10)         NOT NULL DEFAULT ' ',
FDIMVERSION          NVARCHAR(30)         NOT NULL DEFAULT ' ',
FAPPROVERID          BIGINT               NOT NULL DEFAULT 0,
FCREATEORGID         BIGINT               NOT NULL DEFAULT 0,
FCREATERID           BIGINT               NOT NULL DEFAULT 0,
FAPPROVEDATE         DATETIME             ,
FCREATEDATE          DATETIME             ,
FHANDLER             BIGINT               NOT NULL DEFAULT 0,
FDIMENSIONJSON       NCLOB                ,
FDEALDATE            DATETIME             ,
FHANDLERTEXT         NVARCHAR(20)         NOT NULL DEFAULT ' '
);


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_EBAPPROVEBILLENTRY') 
 CREATE TABLE T_BCM_EBAPPROVEBILLENTRY (
   FID                  BIGINT               NOT NULL DEFAULT 0,
   FENTRYID             BIGINT               NOT NULL DEFAULT 0,
   FTEMPID              BIGINT               NOT NULL DEFAULT 0,
   FSEQ                 INT                  NOT NULL DEFAULT 0,
   FTASKPROCESSID       BIGINT               NOT NULL DEFAULT 0,
   FPAGEDIMJSON         NCLOB                ,
   FTASKPROCESSJSON      NCLOB                ,
   FAPPINDEXID          NVARCHAR(1)          NOT NULL DEFAULT ' '
);



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