/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_table.sql **/
 EXEC p_AlterColumn 'T_AR_BUSBILLTAXENTRY', 'FTAXCATEGORYID', 'BIGINT', 'NOT NULL', '0011', '0';

 EXEC p_AlterColumn 'T_AR_BUSBILLTAXENTRY', 'FISINPRICETAX', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_BUSBILLTAXENTRY', 'FTAXTIME', 'NVARCHAR(255)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_BUSBILLTAXENTRY', 'FINCLUDETAIL', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_BUSBILLTAXENTRY', 'FINCLUDEDISCOUNT', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_BUSBILLTAXENTRY', 'FINCLUDEVAT', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_BUSBILLTAXENTRY', 'FCANDEDUCTIBLE', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLTAXENTRY' AND KSQL_COL_NAME ='FSEQ') 
 ALTER TABLE T_AR_BUSBILLTAXENTRY ADD (FSEQ INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLTAXENTRY' AND KSQL_COL_NAME ='FTAXBASETYPE') 
 ALTER TABLE T_AR_BUSBILLTAXENTRY ADD (FTAXBASETYPE CHAR(1) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_AR_FINARBILLTAXENTRY', 'FTAXCATEGORYID', 'BIGINT', 'NOT NULL', '0011', '0';

 EXEC p_AlterColumn 'T_AR_FINARBILLTAXENTRY', 'FISINPRICETAX', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_FINARBILLTAXENTRY', 'FTAXTIME', 'NVARCHAR(255)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_FINARBILLTAXENTRY', 'FINCLUDETAIL', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_FINARBILLTAXENTRY', 'FINCLUDEDISCOUNT', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_FINARBILLTAXENTRY', 'FINCLUDEVAT', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

 EXEC p_AlterColumn 'T_AR_FINARBILLTAXENTRY', 'FCANDEDUCTIBLE', 'CHAR(1)', 'NOT NULL', '0011', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLTAXENTRY' AND KSQL_COL_NAME ='FSEQ') 
 ALTER TABLE T_AR_FINARBILLTAXENTRY ADD (FSEQ INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLTAXENTRY' AND KSQL_COL_NAME ='FTAXBASETYPE') 
 ALTER TABLE T_AR_FINARBILLTAXENTRY ADD (FTAXBASETYPE CHAR(1) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_AR_REVCFMBILLENTRY', 'FASSISTANTATTRID', 'BIGINT', 'NOT NULL', '1111', '0';

 EXEC p_AlterColumn 'T_AR_BUSBILLENTRY', 'FASSISTANTATTRID', 'BIGINT', 'NOT NULL', '1111', '0';

 EXEC p_AlterColumn 'T_AR_FINARBILLENTRY', 'FASSISTANTATTRID', 'BIGINT', 'NOT NULL', '1111', '0';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_RECEIVEDBILLENTRY' AND KSQL_COL_NAME ='FMATERIALVERSIONID') 
 ALTER TABLE T_AR_RECEIVEDBILLENTRY ADD (FMATERIALVERSIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_INVOICEENTRY' AND KSQL_COL_NAME ='FMATERIALVERSIONID') 
 ALTER TABLE T_AR_INVOICEENTRY ADD (FMATERIALVERSIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_FINARBILLENTRY_E' AND KSQL_COL_NAME ='FMATERIALVERSIONID') 
 ALTER TABLE T_AR_FINARBILLENTRY_E ADD (FMATERIALVERSIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FMATERIALVERSIONID') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FMATERIALVERSIONID BIGINT DEFAULT 0 NOT NULL );

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