From f24e11f8c0eb03d85394cc2466483e75f047fbf7 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Fri, 14 Nov 2025 10:20:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/MaterialInbPurchaseApplyPlugin.java | 25 +++++++++++++------ .../MaterialInBillSubmitValidatorOp.java | 4 ++- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbPurchaseApplyPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbPurchaseApplyPlugin.java index d6de4ec..139c729 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbPurchaseApplyPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbPurchaseApplyPlugin.java @@ -349,14 +349,6 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement } else { this.getModel().setValue("zcgj_freight_invoice", false, rowIndex);//运费发票 } - DynamicObject invoiceTypeId = invoice.getDynamicObject("invoicetypeid"); - if (invoiceTypeId != null) { - String invoiceTypeIdName = invoiceTypeId.getString("name"); - if (!invoiceTypeIdName.contains("专")) { - this.getModel().setValue("zcgj_invoicetax", BigDecimal.ZERO, rowIndex); - this.getModel().setValue("zcgj_oftaxinvoiceamount", dataEntity.get("zcgj_invoiceamount"), rowIndex); - } - } } else { this.getModel().setValue("zcgj_freight_invoice", false);//运费发票 } @@ -403,6 +395,23 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement BigDecimal transAmount = (BigDecimal) this.getModel().getValue("transamount");//总运费 BigDecimal totalAmount = matAmount.add(transAmount); this.getModel().setValue("totalamount", totalAmount);//入库总金额 + } else if ("zcgj_applyinvoftaxamt".equals(key)) { + //本次申请金额 + ChangeData[] changeSet = e.getChangeSet(); + ChangeData changeData = changeSet[0]; + int rowIndex = changeData.getRowIndex(); + DynamicObject dataEntity = changeData.getDataEntity(); + DynamicObject invoice = dataEntity.getDynamicObject("zcgj_invoice");//发票号码 + if (invoice != null) { + DynamicObject invoiceTypeId = invoice.getDynamicObject("invoicetypeid"); + if (invoiceTypeId != null) { + String invoiceTypeIdName = invoiceTypeId.getString("name"); + if (!invoiceTypeIdName.contains("专")) { + this.getModel().setValue("zcgj_invoicetax", BigDecimal.ZERO, rowIndex); + this.getModel().setValue("zcgj_oftaxinvoiceamount", dataEntity.get("zcgj_invoiceamount"), rowIndex); + } + } + } } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/MaterialInBillSubmitValidatorOp.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/MaterialInBillSubmitValidatorOp.java index d22a907..8a8292c 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/MaterialInBillSubmitValidatorOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/MaterialInBillSubmitValidatorOp.java @@ -34,6 +34,7 @@ public class MaterialInBillSubmitValidatorOp extends AbstractOperationServicePlu e.getFieldKeys().add("matamount"); e.getFieldKeys().add("mataxamount"); e.getFieldKeys().add("zcgj_freight_invoice"); + e.getFieldKeys().add("zcgj_no_invoice"); } @Override @@ -48,9 +49,10 @@ public class MaterialInBillSubmitValidatorOp extends AbstractOperationServicePlu ExtendedDataEntity[] extendedDataEntities = this.getDataEntities(); for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) { DynamicObject ecma_MaterialInBill = extendedDataEntity.getDataEntity(); + boolean zcgj_no_invoice = ecma_MaterialInBill.getBoolean("zcgj_no_invoice");//无物资发票 DynamicObjectCollection entryEntityCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_entryentity");//合同进项发票信息 DynamicObjectCollection entryEntity2Collection = ecma_MaterialInBill.getDynamicObjectCollection("entryentity");//入库单分录 - if (entryEntityCollection != null && entryEntityCollection.size() > 0 && entryEntity2Collection != null && entryEntity2Collection.size() > 0) { + if (!zcgj_no_invoice && entryEntity2Collection != null && entryEntity2Collection.size() > 0) { String invoice_type = ecma_MaterialInBill.getString("zcgj_invoice_type");//发票类型 boolean zcgj_notraninvoice = ecma_MaterialInBill.getBoolean("zcgj_notraninvoice");//无运费发票