/**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_INVOICEINFOCP' AND KSQL_COL_NAME ='FAIRCONSTFEE') 
 ALTER TABLE T_ER_INVOICEINFOCP ADD (FAIRCONSTFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEINFOCP' AND KSQL_COL_NAME ='FOTHERTOTALTAXAMOUNT') 
 ALTER TABLE T_ER_INVOICEINFOCP ADD (FOTHERTOTALTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEINFOCP' AND KSQL_COL_NAME ='FINSURANCEPREMIUM') 
 ALTER TABLE T_ER_INVOICEINFOCP ADD (FINSURANCEPREMIUM DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEPOOLINFO' AND KSQL_COL_NAME ='FAIRCONSTFEE') 
 ALTER TABLE T_ER_INVOICEPOOLINFO ADD (FAIRCONSTFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEPOOLINFO' AND KSQL_COL_NAME ='FOTHERTOTALTAXAMOUNT') 
 ALTER TABLE T_ER_INVOICEPOOLINFO ADD (FOTHERTOTALTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEPOOLINFO' AND KSQL_COL_NAME ='FINSURANCEPREMIUM') 
 ALTER TABLE T_ER_INVOICEPOOLINFO ADD (FINSURANCEPREMIUM DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMINVOICEINFO' AND KSQL_COL_NAME ='FAIRCONSTFEE') 
 ALTER TABLE T_ER_PUBREIMINVOICEINFO ADD (FAIRCONSTFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMINVOICEINFO' AND KSQL_COL_NAME ='FOTHERTOTALTAXAMOUNT') 
 ALTER TABLE T_ER_PUBREIMINVOICEINFO ADD (FOTHERTOTALTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMINVOICEINFO' AND KSQL_COL_NAME ='FINSURANCEPREMIUM') 
 ALTER TABLE T_ER_PUBREIMINVOICEINFO ADD (FINSURANCEPREMIUM DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEINFO' AND KSQL_COL_NAME ='FAIRCONSTFEE') 
 ALTER TABLE T_ER_INVOICEINFO ADD (FAIRCONSTFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEINFO' AND KSQL_COL_NAME ='FOTHERTOTALTAXAMOUNT') 
 ALTER TABLE T_ER_INVOICEINFO ADD (FOTHERTOTALTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEINFO' AND KSQL_COL_NAME ='FINSURANCEPREMIUM') 
 ALTER TABLE T_ER_INVOICEINFO ADD (FINSURANCEPREMIUM DECIMAL(23,10) DEFAULT 0 NOT NULL );

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