/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILL_E' AND KSQL_COL_NAME ='FBOOKDATE_HW') 
 ALTER TABLE T_CAS_AGENTPAYBILL_E ADD (FBOOKDATE_HW DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_E' AND KSQL_COL_NAME ='FBOOKDATE_HW') 
 ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FBOOKDATE_HW DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_E' AND KSQL_COL_NAME ='FACTUALPAYDATE_HW') 
 ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FACTUALPAYDATE_HW DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME ='FSALERID') 
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FSALERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME ='FACTUALRECDATE_HW') 
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FACTUALRECDATE_HW DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME ='FBOOKDATE_HW') 
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FBOOKDATE_HW DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILLENTRY' AND KSQL_COL_NAME ='FPAYCONDITIONID') 
 ALTER TABLE T_CAS_PAYMENTBILLENTRY ADD (FPAYCONDITIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILLENTRY' AND KSQL_COL_NAME ='FEXPECTVFYDATE') 
 ALTER TABLE T_CAS_PAYMENTBILLENTRY ADD (FEXPECTVFYDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILLENTRY' AND KSQL_COL_NAME ='FEXPIREDATE') 
 ALTER TABLE T_CAS_PAYMENTBILLENTRY ADD (FEXPIREDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILLENTRY' AND KSQL_COL_NAME ='FRECCONDITIONID') 
 ALTER TABLE T_CAS_RECEIVINGBILLENTRY ADD (FRECCONDITIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILLENTRY' AND KSQL_COL_NAME ='FEXPIREDATE') 
 ALTER TABLE T_CAS_RECEIVINGBILLENTRY ADD (FEXPIREDATE DATETIME );

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