入库单导入发票逻辑优化

This commit is contained in:
xuhaihui 2025-12-10 13:46:19 +08:00
parent 2088066db5
commit 7353758ec5
1 changed files with 4 additions and 2 deletions

View File

@ -258,13 +258,15 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
this.getView().showTipNotification(ResManager.loadKDString("导入发票为空。", "PaymentApplyEditUI_19", "ec-contract-formplugin", new Object[0])); this.getView().showTipNotification(ResManager.loadKDString("导入发票为空。", "PaymentApplyEditUI_19", "ec-contract-formplugin", new Object[0]));
} else { } else {
long orgId = (Long) ((DynamicObject) this.getModel().getValue("fiaccountorg")).getPkValue(); long orgId = (Long) ((DynamicObject) this.getModel().getValue("fiaccountorg")).getPkValue();
DynamicObject fiaccountorg = (DynamicObject)this.getModel().getValue("fiaccountorg");//财务记账组织
String ffirmname = fiaccountorg.getString("ffirmname");
Set<DynamicObject> newInvoices = (Set) invoiceMap.get(Boolean.TRUE); Set<DynamicObject> newInvoices = (Set) invoiceMap.get(Boolean.TRUE);
Set<DynamicObject> existInvoices = (Set) invoiceMap.get(Boolean.FALSE); Set<DynamicObject> existInvoices = (Set) invoiceMap.get(Boolean.FALSE);
if (newInvoices != null && !newInvoices.isEmpty()) { if (newInvoices != null && !newInvoices.isEmpty()) {
for (DynamicObject newInvoice : newInvoices) { for (DynamicObject newInvoice : newInvoices) {
DynamicObject buyerOrg = newInvoice.getDynamicObject("buyer"); DynamicObject buyerOrg = newInvoice.getDynamicObject("buyer");
if (buyerOrg != null && buyerOrg.getLong("id") != orgId) { if (buyerOrg != null && !buyerOrg.getString("name").equals(ffirmname) && buyerOrg.getLong("id") != orgId) {
// this.getView().showTipNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0])); this.getView().showTipNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0]));
//this.getView().showErrorNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0])); //this.getView().showErrorNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0]));
return; return;
} }