From 9319acb1c45f5c1518dd918afadbef3bf220b12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=B0=8F=E4=BC=9F?= Date: Mon, 12 May 2025 11:16:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E7=94=B3=E8=AF=B7=E5=8D=95?= =?UTF-8?q?=20=E5=80=99=E8=A1=A5=E5=8F=91=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/SupplementInvoiceBillPlugin.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/SupplementInvoiceBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/SupplementInvoiceBillPlugin.java index 7a45b5f..8b931fe 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/SupplementInvoiceBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/SupplementInvoiceBillPlugin.java @@ -183,6 +183,7 @@ public class SupplementInvoiceBillPlugin extends PaymentApplyEditUI { int rowIndex = this.getModel().createNewEntryRow("subentryentity"); this.getModel().setValue("invoice", invoicePk.toString(), rowIndex); DynamicObject invoice = BusinessDataServiceHelper.loadSingle(invoicePk, "ec_in_invoice", "unapplyinvtax,unapplyamount,isClaimed,contract,project,connecttype,currency,totalamount,totaltax,totaloftaxamount"); + this.getModel().setValue("invoicecurrency", invoice.getDynamicObject("currency") == null ? Long.valueOf("0") : invoice.getDynamicObject("currency").getPkValue(), rowIndex); this.getModel().setValue("invoiceamount", invoice.getBigDecimal("totalamount"), rowIndex); this.getModel().setValue("invoicetax", invoice.getBigDecimal("totaltax"), rowIndex); @@ -199,14 +200,29 @@ public class SupplementInvoiceBillPlugin extends PaymentApplyEditUI { invoice.set("connecttype", "contract"); } -// this.setApplyAmtByInvoice(this.getModel().getEntryCurrentRowIndex("entryentity")); + this.setSingeapplyinvoftaxamt(); +// this.setApplyAmtByInvoice(this.getModel().getEntryCurrentRowIndex("entryentity")); log.info("SupplementInvoiceBillPlugin:发票保存"); SaveServiceHelper.save(invArr);//发票保存 this.getView().invokeOperation("invoicesave"); this.setEnableByInvoice1(); } + private void setSingeapplyinvoftaxamt() { + int rowCount = this.getModel().getEntryRowCount("subentryentity");//获取子单据分录行数 + log.info("SupplementInvoiceBillPlugin:子单据体分录行数:"+rowCount); + EntryGrid grid = (EntryGrid)this.getView().getControl("entryentity");//获取单据体控件-合同付款信息 + int[] entity_rows = grid.getEntryState().getSelectedRows();//获取选择行号 + + DynamicObject rowEntity = this.getModel().getEntryRowEntity("entryentity", entity_rows[0]);//获取对应行的单据体 + BigDecimal applyoftaxamount = rowEntity.getBigDecimal("thisapplyoftax");//获取单据体对应的 本次申请金额 + log.info("SupplementInvoiceBillPlugin:选中的单据体的申请金额数量:" + applyoftaxamount); + if(rowCount==1){ + this.getModel().setValue("applyinvoftaxamt", applyoftaxamount,0); + } + } + protected void setEnableByInvoice1() { int entryRowCount = this.getModel().getEntryRowCount("entryentity"); log.info("SupplementInvoiceBillPlugin:有发票,合同记录锁定 thisapplyoftax thisapplyamout 字段");