/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_BUSY_CHG_RECORD') 
 CREATE TABLE T_FA_BUSY_CHG_RECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FDEPREUSEID BIGINT DEFAULT 0 NOT NULL,
FBILLENTITYNAME VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT 'A' NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FBUSYDATE DATETIME,
FBILLCREATETIME DATETIME,
FBILLMODIFYTIME DATETIME,
FBILLAUDITDATE DATETIME,
FISDELETE CHAR(1) DEFAULT '0' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_BUSY_CHG_REC_ENTRY') 
 CREATE TABLE T_FA_BUSY_CHG_REC_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FREALCARDMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_PERIOD_BUSY_CHG') 
 CREATE TABLE T_FA_PERIOD_BUSY_CHG (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FDEPREUSEID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FREALCARDMASTERID BIGINT DEFAULT 0 NOT NULL
);

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