付款会计科目过滤

This commit is contained in:
程小伟 2025-03-06 14:09:27 +08:00
parent 4ec0e1b517
commit 869bf3eb35
2 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,55 @@
package zcgj.zcdev.zcdev.pr.plugin.form;
import com.icbc.api.response.InvoiceQryVatListResponseV1;
import kd.bos.bill.AbstractBillPlugIn;
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.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.sdk.plugin.Plugin;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EventObject;
import java.util.List;
public class PayBillFilterPlugin extends AbstractBillPlugIn implements Plugin, BeforeF7SelectListener {
private final static String ACCOUNT_ITEM = "zcgj_account_item";//会计科目控件标识
/**
* 监听 会计科目控件
* @param e
*/
@Override
public void registerListener(EventObject e){
super.registerListener(e);
BasedataEdit fieldEdit = this.getView().getControl(ACCOUNT_ITEM);//获取会计科目控件
fieldEdit.addBeforeF7SelectListener(this);//对控件监听
}
@Override
public void beforeF7Select(BeforeF7SelectEvent arg0) {//arg0为触发事件对象
String name = arg0.getProperty().getName();//获取属性字段中的姓名字段值
Object zcgjPaycontract = this.getModel().getValue("zcgj_paycontract");//获取当前页面支付合同的值
//只有捕获控件 才执行业务逻辑
if(zcgjPaycontract != null && name.equals(ACCOUNT_ITEM)){
List<QFilter> qFilterList = new ArrayList<>();//存储过滤条件
qFilterList.add(new QFilter("number", QCP.like,"2202%")//应付账款
.or(new QFilter("number", QCP.like,"2241%"))//其他应付账款
.or(new QFilter("number", QCP.like,"1123%"))//预付账款
);
qFilterList.add(new QFilter("isleaf", QCP.equals,true));//两个add 是and的意思
// arg0.setCustomQFilters(qFilterList);
arg0.setCustomQFilters(qFilterList);//设置F7选择框的筛选条件
}
}
}

View File

@ -0,0 +1,53 @@
package zcgj.zcdev.zcdev.pr.plugin.form;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.form.field.BasedataEdit;
import kd.bos.form.field.events.BeforeF7SelectEvent;
import kd.bos.form.field.events.BeforeF7SelectListener;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.sdk.plugin.Plugin;
import java.util.ArrayList;
import java.util.EventObject;
import java.util.List;
public class ReceiveBillFilterPlugin extends AbstractBillPlugIn implements Plugin, BeforeF7SelectListener {
private final static String ACCOUNT_ITEM = "zcgj_account";//会计科目控件标识
/**
* 监听 会计科目控件
* @param e
*/
@Override
public void registerListener(EventObject e){
super.registerListener(e);
BasedataEdit fieldEdit = this.getView().getControl(ACCOUNT_ITEM);//获取会计科目控件
fieldEdit.addBeforeF7SelectListener(this);//对控件监听
}
@Override
public void beforeF7Select(BeforeF7SelectEvent arg0) {//arg0为触发事件对象
String name = arg0.getProperty().getName();//获取属性字段中的姓名字段值
Object zcgjReceivecontract = this.getModel().getValue("zcgj_reccontract");//获取当前页面收入合同的值
//只有捕获控件 才执行业务逻辑
if(zcgjReceivecontract != null && name.equals(ACCOUNT_ITEM)){
List<QFilter> qFilterList = new ArrayList<>();//存储过滤条件
qFilterList.add(new QFilter("number", QCP.like,"2202%")//应收账款
.or(new QFilter("number", QCP.like,"2241%"))//其他应收账款
.or(new QFilter("number", QCP.like,"1123%"))//预付账款
.or(new QFilter("number", QCP.like,"2204%"))//合同负债
);
qFilterList.add(new QFilter("isleaf", QCP.equals,true));//两个add 是and的意思
// arg0.setCustomQFilters(qFilterList);
arg0.setCustomQFilters(qFilterList);//设置F7选择框的筛选条件
}
}
}