/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIZPERSON' AND KSQL_COL_NAME ='FCREATORCONTROL') 
 ALTER TABLE T_PUR_BIZPERSON ADD (FCREATORCONTROL CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIZPERSON' AND KSQL_COL_NAME ='FORGCONTROL') 
 ALTER TABLE T_PUR_BIZPERSON ADD (FORGCONTROL CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHECKENTRY2' AND KSQL_COL_NAME ='FACTCHECKTAXAMOUNT') 
 ALTER TABLE T_PUR_CHECKENTRY2 ADD (FACTCHECKTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_CHECKENTRY2' AND KSQL_COL_NAME ='FACTCHECKTAXPRICE') 
 ALTER TABLE T_PUR_CHECKENTRY2 ADD (FACTCHECKTAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICENTRY2' AND KSQL_COL_NAME ='FACTCHECKTAXAMOUNT') 
 ALTER TABLE T_PUR_INVOICENTRY2 ADD (FACTCHECKTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICENTRY2' AND KSQL_COL_NAME ='FACTCHECKTAXPRICE') 
 ALTER TABLE T_PUR_INVOICENTRY2 ADD (FACTCHECKTAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGE_A' AND KSQL_COL_NAME ='FSOURCEBILLID') 
 ALTER TABLE T_PUR_ORDCHANGE_A ADD (FSOURCEBILLID VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME ='FSOURCEBILLENTRYID') 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FSOURCEBILLENTRYID VARCHAR(50) DEFAULT ' ' NOT NULL );

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