/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FSOURCEBILLNO')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FSOURCEBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FENTRYCHANGEAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FENTRYCHANGEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FENTRYORICHANGEAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FENTRYORICHANGEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FENTRYAPPLYPROJECTAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FENTRYAPPLYPROJECTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FENTRYCHANGEABLEAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FENTRYCHANGEABLEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FITEMFROM')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FITEMFROM CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FCHANGETAXAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FCHANGETAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FACTAXAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FACTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FCHANGEORIENTRYAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FCHANGEORIENTRYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FACORIENTRYAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FACORIENTRYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FACEXPEAPPROVEAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FACEXPEAPPROVEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTENTRY' AND KSQL_COL_NAME ='FACEXPEAPPROVECURRAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTENTRY ADD (FACEXPEAPPROVECURRAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTBILL' AND KSQL_COL_NAME ='FCHANGETYPE')
 ALTER TABLE T_ER_APPLYPROJECTBILL ADD (FCHANGETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTBILL' AND KSQL_COL_NAME ='FFIPERIOD')
 ALTER TABLE T_ER_APPLYPROJECTBILL ADD (FFIPERIOD DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTBILL' AND KSQL_COL_NAME ='FACAPPROVEAMOUNT')
 ALTER TABLE T_ER_APPLYPROJECTBILL ADD (FACAPPROVEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/
