From aa3d199a70cf8f3739da3f0e7d425744d79b7013 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Tue, 11 Nov 2025 17:45:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E5=87=BA=E5=90=88=E5=90=8C=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E6=B7=BB=E5=8A=A0=E6=8C=89=E5=85=A5=E5=BA=93=E8=BF=90?= =?UTF-8?q?=E8=B4=B9=E7=BB=93=E7=AE=97=E9=80=BB=E8=BE=91=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E5=88=86=E6=91=8A=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/form/CostAllocatorBillPlugin.java | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/CostAllocatorBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/CostAllocatorBillPlugin.java index f6b2632..e5c8e30 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/CostAllocatorBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/CostAllocatorBillPlugin.java @@ -20,7 +20,8 @@ import java.util.Map; /* * 使用插件注册位置:支出合同结算表单插件 - * 说明:新增合同支付项明细后将对应不同分录拆分至工序分摊中 + * 说明:1:新增合同支付项明细后将对应不同分录拆分至工序分摊中 + * 2:新增的入库单分录如上 */ public class CostAllocatorBillPlugin extends AbstractFormPlugin { @@ -30,6 +31,7 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin { this.addItemClickListeners("payitemdetaitoolap");//合同支付项明细工具栏 this.addItemClickListeners("entrytoolbar1");//入库单明细工具栏 } + @Override public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) { super.afterDoOperation(afterDoOperationEventArgs); @@ -39,6 +41,7 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin { this.getView().invokeOperation("refresh"); } } + @Override public void itemClick(ItemClickEvent evt) { super.itemClick(evt); @@ -88,6 +91,7 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin { } } else if (itemKey.equals("removeline1")) { //入库单明细删除按钮 + boolean zcgj_transset = (boolean) this.getModel().getValue("zcgj_transset");//按入库运费结算 DynamicObjectCollection materialInEntryCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("materialinentry");//入库单分录 DynamicObjectCollection itemEntryCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("itementry");//支付项分录 if (itemEntryCollection.size() == 0) { @@ -121,6 +125,23 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin { processAllocEntityCollection.add(newProcessAllocEntity); } + if (zcgj_transset) { + DynamicObjectCollection expensesummaryCollection = ecma_materialInBill.getDynamicObjectCollection("zcgj_expensesummary");//费用汇总 + for (DynamicObject entryEntity : expensesummaryCollection) { + boolean zcgj_isfreightline = entryEntity.getBoolean("zcgj_isfreightline");//运费行 + if (!zcgj_isfreightline) { + continue; + } + DynamicObject newProcessAllocEntity = new DynamicObject(processAllocEntityType); + newProcessAllocEntity.set("zcgj_pa_amount", entryEntity.get("zcgj_pa_amount"));//价税合计-价税合计 + newProcessAllocEntity.set("zcgj_amountnotax", entryEntity.get("zcgj_amountnotax"));//不含税金额-不含税金额 + newProcessAllocEntity.set("zcgj_rateval", entryEntity.get("zcgj_rateval"));//税率(%)-税率(%) + newProcessAllocEntity.set("zcgj_taxamt", entryEntity.get("zcgj_taxamt"));//税额-税额 + newProcessAllocEntity.set("zcgj_expenseitem", entryEntity.get("zcgj_expenseitem"));//费用项目-费用项目 + + processAllocEntityCollection.add(newProcessAllocEntity); + } + } } } @@ -201,6 +222,7 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin { } else if ("matinnumber".equals(name)) { //入库单明细-编码 this.getModel().beginInit(); + boolean zcgj_transset = (boolean) this.getModel().getValue("zcgj_transset");//按入库运费结算 DynamicObject contattr = (DynamicObject) this.getModel().getValue("contattr");//合同属性 if (contattr == null) { return; @@ -242,6 +264,23 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin { processAllocEntityCollection.add(newProcessAllocEntity); } + if (zcgj_transset) { + DynamicObjectCollection expensesummaryCollection = ecma_materialInBill.getDynamicObjectCollection("zcgj_expensesummary");//费用汇总 + for (DynamicObject entryEntity : expensesummaryCollection) { + boolean zcgj_isfreightline = entryEntity.getBoolean("zcgj_isfreightline");//运费行 + if (!zcgj_isfreightline) { + continue; + } + DynamicObject newProcessAllocEntity = new DynamicObject(processAllocEntityType); + newProcessAllocEntity.set("zcgj_pa_amount", entryEntity.get("zcgj_pa_amount"));//价税合计-价税合计 + newProcessAllocEntity.set("zcgj_amountnotax", entryEntity.get("zcgj_amountnotax"));//不含税金额-不含税金额 + newProcessAllocEntity.set("zcgj_rateval", entryEntity.get("zcgj_rateval"));//税率(%)-税率(%) + newProcessAllocEntity.set("zcgj_taxamt", entryEntity.get("zcgj_taxamt"));//税额-税额 + newProcessAllocEntity.set("zcgj_expenseitem", entryEntity.get("zcgj_expenseitem"));//费用项目-费用项目 + + processAllocEntityCollection.add(newProcessAllocEntity); + } + } } }