/**Begin D:\PDM_UPGRADE\PDM1\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ADJBILLPERIODS') 
 CREATE TABLE T_EB_ADJBILLPERIODS (
FID BIGINT DEFAULT 0 NOT NULL,
FPKID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ADJDETAIL') 
 CREATE TABLE T_EB_ADJDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTITY BIGINT DEFAULT 0 NOT NULL,
FACCOUNT BIGINT DEFAULT 0 NOT NULL,
FMETRIC BIGINT DEFAULT 0 NOT NULL,
FCUSTOMDIM1 BIGINT DEFAULT 0 NOT NULL,
FCUSTOMDIM2 BIGINT DEFAULT 0 NOT NULL,
FCUSTOMDIM3 BIGINT DEFAULT 0 NOT NULL,
FCUSTOMDIM4 BIGINT DEFAULT 0 NOT NULL,
FCUSTOMDIM5 BIGINT DEFAULT 0 NOT NULL,
FCUSTOMDIM6 BIGINT DEFAULT 0 NOT NULL,
FBUDGETDATA DECIMAL(23,10) DEFAULT 0 NOT NULL,
FADJUSTDATA DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFINALDATA DECIMAL(23,10) DEFAULT 0 NOT NULL,
FADJEXPLAIN NVARCHAR(255) DEFAULT ' ' NOT NULL,
FGROUPNUM NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPERIOD BIGINT DEFAULT 0 NOT NULL,
FORDERSIGN NVARCHAR(30) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ADJUSTBILL') 
 CREATE TABLE T_EB_ADJUSTBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDEPARTMENT BIGINT DEFAULT 0 NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FVERSION BIGINT DEFAULT 0 NOT NULL,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FCHANGETYPE BIGINT DEFAULT 0 NOT NULL,
FCURRENCY BIGINT DEFAULT 0 NOT NULL,
FAPPLYDATE DATETIME,
FDEALDATE DATETIME,
FADJUSTREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOMPANY BIGINT DEFAULT 0 NOT NULL,
FPOSITION NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(5) DEFAULT ' ' NOT NULL,
FBILLTYPE NVARCHAR(5) DEFAULT ' ' NOT NULL,
FAPPLIER BIGINT DEFAULT 0 NOT NULL,
FHANDLER BIGINT DEFAULT 0 NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\EB_table.sql **/
