/**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_BIZDATA_L') 
 CREATE TABLE T_HPDI_BIZDATA_L (
FPKID VARCHAR(18) DEFAULT '0' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT '0' NOT NULL,
FERRORMSG NVARCHAR(1000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_BIZDATABILL') 
 CREATE TABLE T_HPDI_BIZDATABILL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FIMPORTTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FBILLTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FDATASTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FBIZITEMGROUPID BIGINT DEFAULT 0 NOT NULL,
FPERSONCOUNT INT DEFAULT 0 NOT NULL,
FBIZITEMCOUNT INT DEFAULT 0 NOT NULL,
FBIZDATACOUNT INT DEFAULT 0 NOT NULL,
FBIZDATAOBJRULEID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_BIZDATABILLENT') 
 CREATE TABLE T_HPDI_BIZDATABILLENT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FEMPPOSORGRELVID BIGINT DEFAULT 0 NOT NULL,
FSALARYFILEID BIGINT DEFAULT 0 NOT NULL,
FPAYROLLGRPID BIGINT DEFAULT 0 NOT NULL,
FBIZITEMID BIGINT DEFAULT 0 NOT NULL,
FEFFECTIVEDATE DATETIME,
FEXPIRYDATE DATETIME,
FBIZDATE DATETIME,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FVALUE VARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK VARCHAR(255) DEFAULT ' ' NOT NULL,
FDATAAPPROVESTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FAPPROVEDESC VARCHAR(500) DEFAULT ' ' NOT NULL,
FBIZDATASTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FERRORMSG NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FSUBMITERROR VARCHAR(2) DEFAULT ' ' NOT NULL,
FBIZDATACODE VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HPDI_BIZDATA') 
 CREATE TABLE T_HPDI_BIZDATA (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FEMPPOSORGRELVID BIGINT DEFAULT 0 NOT NULL,
FSALARYFILEID BIGINT DEFAULT 0 NOT NULL,
FPAYROLLGRPID BIGINT DEFAULT 0 NOT NULL,
FBIZDATE DATETIME,
FBIZITEMID BIGINT DEFAULT 0 NOT NULL,
FEFFECTIVEDATE DATETIME,
FEXPIRYDATE DATETIME,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FVALUE VARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FSUBMITDATE DATETIME,
FCALSALARYDATE DATETIME,
FBIZDATASTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FERRORMSG NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FTRANSSALARYERROR VARCHAR(2) DEFAULT ' ' NOT NULL,
FBIZDATACODE VARCHAR(255) DEFAULT ' ' NOT NULL,
FBATCHNUM VARCHAR(255) DEFAULT ' ' NOT NULL,
FBIZITEMGROUPID BIGINT DEFAULT 0 NOT NULL,
FSUBMISSION VARCHAR(2) DEFAULT ' ' NOT NULL,
FCALPERIODID BIGINT DEFAULT 0 NOT NULL
);



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