/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY' AND KSQL_COL_NAME ='FUNWOFFNOTAXAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY ADD (FUNWOFFNOTAXAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY' AND KSQL_COL_NAME ='FUNWOFFNOTAXLOCAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY ADD (FUNWOFFNOTAXLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY' AND KSQL_COL_NAME ='FUNWOFFTAX') 
 ALTER TABLE T_AR_BUSBILLENTRY ADD (FUNWOFFTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY' AND KSQL_COL_NAME ='FUNWOFFTAXLOCAL') 
 ALTER TABLE T_AR_BUSBILLENTRY ADD (FUNWOFFTAXLOCAL DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FUNWOFFNOTAXAMT') 
 ALTER TABLE T_AR_BUSBILL ADD (FUNWOFFNOTAXAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FUNWOFFNOTAXLOCAMT') 
 ALTER TABLE T_AR_BUSBILL ADD (FUNWOFFNOTAXLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FUNWOFFTAX') 
 ALTER TABLE T_AR_BUSBILL ADD (FUNWOFFTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FUNWOFFTAXLOCAL') 
 ALTER TABLE T_AR_BUSBILL ADD (FUNWOFFTAXLOCAL DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
 
 

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARPLANENTRY' AND KSQL_COL_NAME ='FPLANMATERIAL') 
 ALTER TABLE T_AR_FINARPLANENTRY ADD (FPLANMATERIAL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARPLANENTRY' AND KSQL_COL_NAME ='FPLANEXPENSEITEM') 
 ALTER TABLE T_AR_FINARPLANENTRY ADD (FPLANEXPENSEITEM BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARPLANENTRY' AND KSQL_COL_NAME ='FPLANCOREBILLNO') 
 ALTER TABLE T_AR_FINARPLANENTRY ADD (FPLANCOREBILLNO NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARPLANENTRY' AND KSQL_COL_NAME ='FPLANPROJECT') 
 ALTER TABLE T_AR_FINARPLANENTRY ADD (FPLANPROJECT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARPLANENTRY' AND KSQL_COL_NAME ='FPLANCONTRACT') 
 ALTER TABLE T_AR_FINARPLANENTRY ADD (FPLANCONTRACT NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILL' AND KSQL_COL_NAME ='FSPLITSCHEME') 
 ALTER TABLE T_AR_FINARBILL ADD (FSPLITSCHEME BIGINT DEFAULT 0 NOT NULL );
