/**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_EXPENSEDETAIL' AND KSQL_COL_NAME IN ('FDEDUCTIBLETAX')) 
 ALTER TABLE T_ER_EXPENSEDETAIL ADD (FDEDUCTIBLETAX DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REIMBURSEENTRY' AND KSQL_COL_NAME IN ('FDEDUCTIBLETAX')) 
 ALTER TABLE T_ER_REIMBURSEENTRY ADD (FDEDUCTIBLETAX DECIMAL(19,6) DEFAULT 0 NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 -- 删除发票流水号
 EXEC p_AlterColumn 'T_ER_REIMBURSEENTRY', 'FSERIALNO', 'NULL', 'NULL', '1001', 'NULL';
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/
