匹配的规则分录行中"取规则得映射表客户"为true,按照收款入账中心的对方户名去映射表过滤客户(新增组织过滤)
--s
This commit is contained in:
		
							parent
							
								
									08bbe9463a
								
							
						
					
					
						commit
						096a5e22f0
					
				|  | @ -97,6 +97,12 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme | |||
|             QFilter q2 = new QFilter("entryentity.e_rulesname", QCP.equals, rulename); | ||||
|             QFilter q3 = new QFilter("enable", QCP.equals, "1"); | ||||
|             q2 = q2.and(q3); | ||||
|             DynamicObject org = bill.getDynamicObject("org"); | ||||
|             if (null != org) { | ||||
|                 long orgid = org.getLong("id"); | ||||
|                 QFilter q4 = new QFilter("org_entry.u_org.id", QCP.equals,orgid ); | ||||
|                 q2  = q2.and(q4); | ||||
|             } | ||||
|             DynamicObject rule = BusinessDataServiceHelper.loadSingle("cas_recpayrule", q2.toArray()); | ||||
|             if (null != rule) { | ||||
|                 //根据适配规则携带对应分录的业务大类,业务小类,成本中心,利润中心 | ||||
|  | @ -108,32 +114,49 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme | |||
|                          * 2.匹配的规则分录行中"取规则得映射表客户"为true,按照收款入账中心的对方户名去映射表过滤客户 | ||||
|                          * 3若没有,取"1042086_不明确客户"为默认值,携带到收款单的收款人名称,id字段, | ||||
|                          * 4.并且将对方户名携带到收款单备注字段中 | ||||
|                          * | ||||
|                          * 2025/6/16 优化: | ||||
|                          * 携带付款方,根据流水中对方户名去系统找是否有这个客户 | ||||
|                          * 1)有就携带至收款单上2)系统中没有这个客户(1.如果开了取映射表按钮,就去映射表中找,找到即携带2.如果没开/没找到就取不明确客户)修改付款人类型改为客户 | ||||
|                          */ | ||||
| //                        long payer = bill.getLong("payer");//付款人id | ||||
| //                        if (payer == 0) { | ||||
|                             boolean shjhEGetcustomer = entry.getBoolean("shjh_e_getcustomer");//取规则得映射表客户标记 | ||||
|                         String oppunit = beiIntelpay.getString("oppunit");//收款入账中心的对方户名 | ||||
|                         bill.set("shjh_dfhm", oppunit);//收款单备注字段 | ||||
|                         bill.set("payertype", "bd_customer");//付款人类型:客户 | ||||
|                         DynamicObject bd_customer = BusinessDataServiceHelper.loadSingle("bd_customer", new QFilter[]{new QFilter("name", QCP.equals, oppunit)}); | ||||
|                         if (null != bd_customer) { | ||||
|                             bill.set("payer", bd_customer.getPkValue()); //付款人id | ||||
|                             bill.set("payername", bd_customer.getString("name")); //付款人名称 | ||||
|                         } else { | ||||
|                             boolean shjhEGetcustomer = entry.getBoolean("shjh_e_getcustomer"); //取规则得映射表客户标记 | ||||
|                             if (shjhEGetcustomer) { | ||||
|                                 String oppunit = beiIntelpay.getString("oppunit");//收款入账中心的对方户名 | ||||
|                                 bill.set("shjh_dfhm", oppunit);//收款单备注字段 | ||||
|                                 QFilter qFilter = new QFilter("shjh_dfhm", QCP.equals, oppunit); | ||||
|                                 //对方户名与客户名称映射表 shjh_dfhmcust | ||||
|                                 DynamicObject shjhDfhmcust = BusinessDataServiceHelper.loadSingle("shjh_dfhmcust", qFilter.toArray()); | ||||
|                                 if (null != shjhDfhmcust) { | ||||
|                                     DynamicObject shjhCustomer = shjhDfhmcust.getDynamicObject("shjh_customer"); | ||||
|                                     if (null != shjhCustomer) { | ||||
|                                         bill.set("payer", shjhCustomer.getPkValue());//付款人id | ||||
|                                         bill.set("payername", shjhCustomer.getString("name"));//付款人名称 | ||||
|                                         bill.set("payer", shjhCustomer.getPkValue()); //付款人id | ||||
|                                         bill.set("payername", shjhCustomer.getString("name")); //付款人名称 | ||||
|                                     } | ||||
|                                 }else { | ||||
|                                     QFilter qFilter1 = new QFilter("number", QCP.equals, "1042086");//4000042 | ||||
|                                     QFilter qFilter1 = new QFilter("number", QCP.equals, "1042086"); //4000042 | ||||
|                                     DynamicObject bdCustomer = BusinessDataServiceHelper.loadSingle("bd_customer", qFilter1.toArray()); | ||||
|                                     if (null != bdCustomer) { | ||||
|                                         bill.set("payer", bdCustomer.getPkValue());//付款人id | ||||
|                                         bill.set("payername", bdCustomer.getString("name"));//付款人名称 | ||||
|                                         bill.set("payer", bdCustomer.getPkValue()); //付款人id | ||||
|                                         bill.set("payername", bdCustomer.getString("name")); //付款人名称 | ||||
|                                     } | ||||
|                                 } | ||||
|                             }else { | ||||
|                                 QFilter qFilter1 = new QFilter("number", QCP.equals, "1042086"); //4000042 | ||||
|                                 DynamicObject bdCustomer = BusinessDataServiceHelper.loadSingle("bd_customer", qFilter1.toArray()); | ||||
|                                 if (null != bdCustomer) { | ||||
|                                     bill.set("payer", bdCustomer.getPkValue()); //付款人id | ||||
|                                     bill.set("payername", bdCustomer.getString("name")); //付款人名称 | ||||
|                                 } | ||||
|                             } | ||||
| //                        } | ||||
|                         } | ||||
| 
 | ||||
| 
 | ||||
|                         DynamicObject shjhBizbig = (DynamicObject) bill.get("shjh_bizebig");//收款单的业务大类 | ||||
|                         if (null == shjhBizbig) { | ||||
|                             bill.set("shjh_bizebig", entry.getDynamicObject("shjh_e_bizbig")); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue