/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HPDI_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_ADJVERBILL') 
 CREATE TABLE T_HPDI_ADJVERBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FBARCODE VARCHAR(60) DEFAULT ' ' NOT NULL,
FEVENTEFFECTDATE DATETIME,
FISEXISTSWORKFLOW CHAR(1) DEFAULT '0' NOT NULL,
FINPUTDEVICETYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FAUDITSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FPERSONNAME NVARCHAR(150) DEFAULT ' ' NOT NULL,
FEMPNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FACTIONID BIGINT DEFAULT 0 NOT NULL,
FFLOWTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FDUTYWORKROLEID BIGINT DEFAULT 0 NOT NULL,
FORGMSGRECVCENTERID BIGINT DEFAULT 0 NOT NULL,
FTASKRULEID BIGINT DEFAULT 0 NOT NULL,
FTASKCENTERID BIGINT DEFAULT 0 NOT NULL,
FPERSONVID BIGINT DEFAULT 0 NOT NULL,
FEMPLOYEEVID BIGINT DEFAULT 0 NOT NULL,
FDEPEMPVID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FRELBILLID BIGINT DEFAULT 0 NOT NULL,
FCMPEMPVID BIGINT DEFAULT 0 NOT NULL,
FCHANGETIME DATETIME,
FTASKRULEVID BIGINT DEFAULT 0 NOT NULL,
FORGTEAMID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FTASKARRANGECLASS VARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKARRANGEID BIGINT DEFAULT 0 NOT NULL,
FCOLLATASKCLASS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOLLATASKID BIGINT DEFAULT 0 NOT NULL,
FMORGID BIGINT DEFAULT 0 NOT NULL,
FTASKARRANGEVID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_ADJVERBILL_L') 
 CREATE TABLE T_HPDI_ADJVERBILL_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_ADJVERBILLDETAIL') 
 CREATE TABLE T_HPDI_ADJVERBILLDETAIL (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFIELDNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FFIELDVALUE VARCHAR(255) DEFAULT ' ' NOT NULL,
FGROUPINDEX INT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_ADJVERBILLENT') 
 CREATE TABLE T_HPDI_ADJVERBILLENT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBIZAPPID VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZOBJECTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FCARDTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FTRIGGERCOLLAID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);



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