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 字段");