|  | @@ -121,31 +121,21 @@ public class InvoiceAfterCheckEvent implements IRule<InvoiceVO>{
 | 
	
		
			
				|  |  |  								//比较抬头
 | 
	
		
			
				|  |  |  								String sql1 = "select name from org_financeorg_v where pk_vid ='"+InvoiceVO.getParent().getAttributeValue("pk_org_v")+"'";
 | 
	
		
			
				|  |  |  								String orgname = (String) bs.executeQuery(sql1, new ColumnProcessor());
 | 
	
		
			
				|  |  | +							
 | 
	
		
			
				|  |  |  								// 使用正则表达式替换中文括号为英文括号
 | 
	
		
			
				|  |  |  								String orgnames = orgname.replaceAll("(", "(").replaceAll(")", ")");
 | 
	
		
			
				|  |  |  								String name2 = defdocVO.getName2().replaceAll("(", "(").replaceAll(")", ")");
 | 
	
		
			
				|  |  | -								
 | 
	
		
			
				|  |  | -								//上海天华嘉易建筑设计有限公司(建筑) 上海天华嘉易建筑设计有限公司两家公司共用上海天华嘉易建筑设计有限公司抬头
 | 
	
		
			
				|  |  | -								//上海天华嘉易建筑设计有限公司(建筑)制单时去掉(建筑),保证能使用同一个抬头
 | 
	
		
			
				|  |  | -								if("上海天华嘉易建筑设计有限公司(建筑)".equals(orgnames)) {
 | 
	
		
			
				|  |  | -									 orgnames = orgnames.replace("(建筑)", "");
 | 
	
		
			
				|  |  | -								}
 | 
	
		
			
				|  |  | -								//上海天华室内设计有限公司(嘉易工程) 上海天华室内设计有限公司两家公司共用上海天华室内设计有限公司抬头
 | 
	
		
			
				|  |  | -								//上海天华室内设计有限公司(嘉易工程)制单时去掉(嘉易工程),保证能使用同一个抬头
 | 
	
		
			
				|  |  | -								if("上海天华室内设计有限公司(嘉易工程)".equals(orgnames)) {
 | 
	
		
			
				|  |  | -									orgnames = orgnames.replace("(嘉易工程)", "");
 | 
	
		
			
				|  |  | -								}
 | 
	
		
			
				|  |  | -								//上海天华机电(北方)事业部不是一家实际的公司,开票时开的是上海天华建筑设计有限公司
 | 
	
		
			
				|  |  | -								//如果制单组织是上海天华机电(北方)事业部时,将该字段替换成上海天华建筑设计有限公司,确保后续校验
 | 
	
		
			
				|  |  | -								if("上海天华机电(北方)事业部".equals(orgnames)) {
 | 
	
		
			
				|  |  | -									orgnames = "上海天华建筑设计有限公司";
 | 
	
		
			
				|  |  | -								}
 | 
	
		
			
				|  |  | +								//因有的公司是虚拟公司没有抬头,查询name2是否有匹配的抬头,存在使用档案中维护的。
 | 
	
		
			
				|  |  | +								String docsql = "select mnecode as invoiceTitle from bd_defdoc where pk_defdoclist = (select pk_defdoclist from bd_defdoclist "
 | 
	
		
			
				|  |  | +										+ "where code = 'kpttys' and dr = 0) and name = '"+orgnames+"' and enablestate = 2 and dr = 0";
 | 
	
		
			
				|  |  | +								String invoiceTitle = (String) bs.executeQuery(docsql, new ColumnProcessor());
 | 
	
		
			
				|  |  | +								//存在使用维护抬头
 | 
	
		
			
				|  |  | +								if(invoiceTitle != null) {
 | 
	
		
			
				|  |  | +									orgnames = invoiceTitle;
 | 
	
		
			
				|  |  | +								}								
 | 
	
		
			
				|  |  |  								if(!orgnames.equals(name2)) {
 | 
	
		
			
				|  |  | -									
 | 
	
		
			
				|  |  |  									ExceptionUtils.wrappBusinessException("发票抬头与财务组织不一致,请修改财务组织!");
 | 
	
		
			
				|  |  |  								}
 | 
	
		
			
				|  |  | -								
 | 
	
		
			
				|  |  | -								
 | 
	
		
			
				|  |  |  								//比较纳税人识别号
 | 
	
		
			
				|  |  |  								StringBuffer sql2 = new StringBuffer();
 | 
	
		
			
				|  |  |  								sql2.append("SELECT");
 | 
	
	
		
			
				|  | @@ -181,7 +171,6 @@ public class InvoiceAfterCheckEvent implements IRule<InvoiceVO>{
 | 
	
		
			
				|  |  |  					norigtaxmny1 = norigtaxmny1.add(invoiceItemVO.getNorigtaxmny());
 | 
	
		
			
				|  |  |  					nmny1 = nmny1.add(invoiceItemVO.getNmny());
 | 
	
		
			
				|  |  |  					ntax1 = ntax1.add(invoiceItemVO.getNtax());
 | 
	
		
			
				|  |  | -					
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  				//没有使用ocr,并且没有上游不比较金额
 | 
	
		
			
				|  |  |  				if(vbdboo && idboo) {
 |