/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/
/* 费用报销单, 费用明细分录增加"来源"字段  wenyue_chi**/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSEDETAIL' AND KSQL_COL_NAME IN ('FITEMFROM')) 
 ALTER TABLE T_ER_EXPENSEDETAIL ADD (FITEMFROM VARCHAR(2) DEFAULT '0' NOT NULL );

/*费用报销单, 费用明细分录, 增加发票类型字段*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSEDETAIL' AND KSQL_COL_NAME IN ('FINVOICETYPEITEM')) 
 ALTER TABLE T_ER_EXPENSEDETAIL ADD (FINVOICETYPEITEM VARCHAR(2) DEFAULT '0' NOT NULL );

 /*费用报销单, 发票明细分录添加可抵扣字段*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEITEM' AND KSQL_COL_NAME IN ('FINVOICEITEMOFFSET')) 
 ALTER TABLE T_ER_INVOICEITEM ADD (FINVOICEITEMOFFSET CHAR(1) DEFAULT '0' NOT NULL );
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/
