缺补代码提交

This commit is contained in:
“wyx12345678” 2024-07-08 12:01:01 +08:00
parent 0249b0c1cd
commit 3f5ff6ed61
3 changed files with 77 additions and 10 deletions

View File

@ -80,7 +80,7 @@ public class ConvertBillPlugln extends AbstractConvertPlugIn implements Plugin {
entry.get(i).set("e_payableamt",loanamount); //应付
entry.get(i).set("e_payablelocamt", loanamount);
entry.get(i).set("e_unsettledlocalamt.", multiply);
entry.get(i).set("e_unsettledlocalamt", multiply);
entry.get(i).set("e_unlockamt", multiply);
entry.get(i).set("e_unsettledamt", multiply);
// entry.get(i).set("e_payableamt", multiply);

View File

@ -8,16 +8,23 @@ import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.control.Control;
import kd.bos.form.field.BasedataEdit;
import kd.bos.form.field.events.BeforeF7SelectEvent;
import kd.bos.form.field.events.BeforeF7SelectListener;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.list.ListShowParameter;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.plugin.Plugin;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.EventObject;
/**
* 动态表单插件
*/
public class TripReimBillStaAmountCalculationFormPlugin extends AbstractFormPlugin implements Plugin {
public class TripReimBillStaAmountCalculationFormPlugin extends AbstractFormPlugin implements BeforeF7SelectListener,Plugin {
@Override
@ -27,6 +34,15 @@ public class TripReimBillStaAmountCalculationFormPlugin extends AbstractFormPlug
// std_costcenter.setMustInput(true);
}
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
BasedataEdit edit = this.getView().getControl("expenseitem");
if (edit != null){
edit.addBeforeF7SelectListener(this);
}
}
@Override
public void propertyChanged(PropertyChangedArgs e) {
super.propertyChanged(e);
@ -57,11 +73,24 @@ public class TripReimBillStaAmountCalculationFormPlugin extends AbstractFormPlug
}
@Override
public void afterCreateNewData(EventObject e) {
super.afterCreateNewData(e);
DynamicObjectCollection entryentity = this.getModel().getEntryEntity("entryentity");
for (DynamicObject dynamicObject : entryentity) {
DynamicObject expenseitem = dynamicObject.getDynamicObject("expenseitem");
if(expenseitem!=null&&"0016".equals(expenseitem.getString("number"))){
QFilter qFilter = new QFilter("number", QCP.equals, "GL02_03_03"); //住宿费
DynamicObject er_expenseitemedit = BusinessDataServiceHelper.loadSingle("er_expenseitemedit", qFilter.toArray());
dynamicObject.set("travelexpenseitem",er_expenseitemedit);
}
}
}
@Override
public void afterAddRow(AfterAddRowEventArgs e) {
super.afterAddRow(e);
String name = e.getEntryProp().getName();
if ("accountentry".equals(name)) {
Object std_costcenter = this.getModel().getValue("std_costcenter");
@ -73,4 +102,35 @@ public class TripReimBillStaAmountCalculationFormPlugin extends AbstractFormPlug
this.getView().updateView("entryentity");
}
}
@Override
public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
String name = beforeF7SelectEvent.getProperty().getName();
int row = beforeF7SelectEvent.getRow();
if("expenseitem".equals(name)){
//住宿费只显示住宿费
Object travelexpenseitem = this.getModel().getValue("travelexpenseitem", row);
if(travelexpenseitem!=null){
DynamicObject dynamicobject = (DynamicObject)travelexpenseitem;
String number = dynamicobject.getString("number");
if("GL02_03_01".equals(number)){
QFilter qFilter = new QFilter("number", QCP.equals, "0015"); //住宿费
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
formShowParameter.getListFilterParameter().setFilter(qFilter);
} else if ("GL02_03_03".equals(number)){
QFilter qFilter = new QFilter("number", QCP.equals, "0016"); //补助
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
formShowParameter.getListFilterParameter().setFilter(qFilter);
} else if ("GL02_03_02".equals(number)) {
ArrayList<Object> item = new ArrayList<>();
item.add("0015");
item.add("0016");
QFilter qFilter = new QFilter("number", QCP.not_in, item); //住宿费
ListShowParameter formShowParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
formShowParameter.getListFilterParameter().setFilter(qFilter);
}
}
}
}
}

View File

@ -38,10 +38,16 @@ public class GenerateSKClickPlugln extends AbstractBillPlugIn implements Plugin
public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
// super.afterDoOperation(afterDoOperationEventArgs);
if("shkd_shoukuan".equals(afterDoOperationEventArgs.getOperateKey())){
Object billpayerid = this.getModel().getValue("billpayerid");
if(billpayerid==null){
this.getView().showErrMessage(" 缺失信息提示!","请选择往来单位!");
return;
}
DynamicObject suppler=(DynamicObject)this.getModel().getValue("billpayerid");
String number = suppler.getString("number");
DynamicObject currency = (DynamicObject)this.getModel().getValue("currency");
DynamicObject temp2 = BusinessDataServiceHelper.loadSingle("bd_supplier",
new QFilter("number", QFilter.equals, "2020071139634629").toArray());
new QFilter("number", QFilter.equals, number).toArray());
String name = temp2.getString("name");
DynamicObject bankEntry = temp2.getDynamicObjectCollection("entry_bank").get(0);
String bankaccount = bankEntry.getString("bankaccount");
@ -71,11 +77,11 @@ public class GenerateSKClickPlugln extends AbstractBillPlugIn implements Plugin
sk.set("payerbank", bank);//payerbank 开户银行
sk.set("oriaccnotpayamount",expenseamount); //未付金额
sk.set("accnotpayamount",expenseamount); //未付金额
sk.set("accnotpayamount",expenseamount); //未付金额
// sk.set("accnotpayamount",expenseamount); //未付金额
sk.set("accexchangerate",BigDecimal.ONE); //未付金额
sk.set("receiveamount",expenseamount); //未付金额
sk.set("accountcurrency",expenseamount); //未付金额
sk.set("accountcurrency",currency); //未付金额
sk.set("supplier",temp2);
}
this.getView().updateView("accountentry");
this.getView().showTipNotification("生成收款明细成功!");
@ -100,9 +106,10 @@ public class GenerateSKClickPlugln extends AbstractBillPlugIn implements Plugin
@Override
public void afterCreateNewData(EventObject e) {
super.afterCreateNewData(e);
String shkd_billtypefield = this.getModel().getValue("shkd_billtypefield").toString();
if("er_publicreimbursebill_BT_03".equals(shkd_billtypefield)){
this.getModel().setValue("ispaybyhead",true);
DynamicObject shkd_billtypefield = (DynamicObject)this.getModel().getValue("shkd_billtypefield");
String number = shkd_billtypefield.getString("number");
if("er_publicreimbursebill_BT_03".equals(number)){
this.getModel().setValue("ispaybyhead",false);
}
}