对公报销单无合同付款
This commit is contained in:
parent
35312eb62b
commit
920644b29e
|
@ -60,7 +60,8 @@ public class CostcompanyDefaultPlugin extends AbstractBillPlugIn implements Plu
|
|||
}else if("er_publicreimbursebill".equals(billFormId)){
|
||||
//对公报销单隐藏 个人
|
||||
Object company = this.getModel().getValue("costcompany");//核算组织
|
||||
if(company!=null) {
|
||||
boolean isec=(boolean)this.getModel().getValue("zcgj_isec");
|
||||
if(company!=null && !isec) {
|
||||
DynamicObject companyObj = (DynamicObject) company;
|
||||
Long companyId = companyObj.getLong("id");
|
||||
if (OrgCheckUtils.isKS(companyId)) {
|
||||
|
|
|
@ -4,6 +4,7 @@ import kd.bos.bill.AbstractBillPlugIn;
|
|||
import kd.bos.bill.BillShowParameter;
|
||||
import kd.bos.bill.OperationStatus;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.entity.LocaleString;
|
||||
import kd.bos.dataentity.metadata.IDataEntityProperty;
|
||||
import kd.bos.dataentity.resource.ResManager;
|
||||
|
@ -14,10 +15,13 @@ import kd.bos.form.ClientProperties;
|
|||
import kd.bos.form.FormShowParameter;
|
||||
import kd.bos.form.control.AttachmentPanel;
|
||||
import kd.bos.form.control.EntryGrid;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.form.events.AfterDoOperationEventArgs;
|
||||
import kd.bos.form.events.PreOpenFormEventArgs;
|
||||
import kd.bos.form.events.SetFilterEvent;
|
||||
import kd.bos.form.field.BasedataEdit;
|
||||
import kd.bos.form.field.ComboEdit;
|
||||
import kd.bos.form.field.ComboItem;
|
||||
import kd.bos.form.field.RefBillEdit;
|
||||
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
||||
import kd.bos.form.field.events.BeforeF7SelectListener;
|
||||
|
@ -63,6 +67,7 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn impl
|
|||
this.getView().setFormTitle(new LocaleString("无合同付款申请单"));
|
||||
this.getModel().setValue("zcgj_nocontract","NOCONTRACT");
|
||||
this.getView().setEnable(false,"zcgj_nocontract");
|
||||
this.getView().setVisible(false,"zcgj_nocontract");
|
||||
|
||||
//修改单据体高级面板字段名称
|
||||
Map<String, Object> cyf = new HashMap<String, Object>();
|
||||
|
@ -72,6 +77,15 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn impl
|
|||
this.getView().updateControlMetadata("advconap", cyf1);//参数1:单据体标识
|
||||
this.getView().updateView("advconap");
|
||||
|
||||
String eEcpaytype = (String) this.getModel().getValue("zcgj_ecpaytype");
|
||||
List<ComboItem> comboList = new ArrayList<>();
|
||||
if("DG".equals(eEcpaytype)){
|
||||
comboList.add(new ComboItem(new LocaleString("供应商"), "bd_supplier"));
|
||||
}else if("DS".equals(eEcpaytype)){
|
||||
comboList.add(new ComboItem(new LocaleString("个人"), "er_payeer"));
|
||||
}
|
||||
ComboEdit comboEdit = getView().getControl("payertype");
|
||||
comboEdit.setComboItems(comboList);
|
||||
}
|
||||
BillShowParameter bsp=(BillShowParameter)this.getView().getFormShowParameter();
|
||||
if(bsp.getStatus()!=OperationStatus.ADDNEW){
|
||||
|
@ -86,10 +100,12 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn impl
|
|||
this.getModel().setValue("zcgj_ec_project", project[0]);
|
||||
}
|
||||
}
|
||||
List<ComboItem> comboList = new ArrayList<>();
|
||||
comboList.add(new ComboItem(new LocaleString("供应商"), "bd_supplier"));
|
||||
//comboList.add(new ComboItem(new LocaleString("个人"), "er_payeer"));
|
||||
ComboEdit comboEdit = getView().getControl("payertype");
|
||||
comboEdit.setComboItems(comboList);
|
||||
}
|
||||
/* EntryGrid entryGrid = this.getControl("writeoffmoney");
|
||||
entryGrid.setColumnProperty("advconap",
|
||||
ClientProperties.Header, new LocaleString("冲预付"));*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,7 +153,27 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn impl
|
|||
this.getModel().setValue("zcgj_ec_project", project[0]);
|
||||
}
|
||||
}
|
||||
}else if(name.equals("zcgj_ecpaytype")){
|
||||
ChangeData changeData = e.getChangeSet()[0];
|
||||
String ecpaytype = (String)changeData.getNewValue();
|
||||
DynamicObjectCollection accountentry = this.getModel().getDataEntity().getDynamicObjectCollection("accountentry");
|
||||
accountentry.clear();
|
||||
DynamicObject dynamicObject = accountentry.addNew();
|
||||
|
||||
List<ComboItem> comboList = new ArrayList<>();
|
||||
if("DG".equals(ecpaytype)){
|
||||
comboList.add(new ComboItem(new LocaleString("供应商"), "bd_supplier"));
|
||||
dynamicObject.set("payertype","bd_supplier");
|
||||
}else if("DS".equals(ecpaytype)){
|
||||
comboList.add(new ComboItem(new LocaleString("个人"), "er_payeer"));
|
||||
dynamicObject.set("payertype","er_payeer");
|
||||
}
|
||||
ComboEdit comboEdit = getView().getControl("payertype");
|
||||
comboEdit.setComboItems(comboList);
|
||||
|
||||
this.getView().updateView("accountentry");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -151,6 +187,9 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn impl
|
|||
|
||||
RefBillEdit zcgj_maintenanceack = this.getView().getControl("zcgj_maintenanceack");//设备维修确认单
|
||||
zcgj_maintenanceack.addBeforeF7SelectListener(this);
|
||||
|
||||
this.addItemClickListeners("receiveentrytoolbar");//收款信息 增行
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,35 +202,57 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn impl
|
|||
if("zcgj_materialinbill".equals(propertyName)){ //费用承担公司过滤
|
||||
DynamicObject billpayerid = (DynamicObject)this.getModel().getValue("billpayerid");
|
||||
DynamicObject costcompany = (DynamicObject)this.getModel().getValue("costcompany");
|
||||
if(billpayerid!=null && costcompany!=null){
|
||||
List<QFilter> qFilter = new ArrayList<>();
|
||||
if(billpayerid!=null ){
|
||||
Long payerid = billpayerid.getLong("id");
|
||||
Long companyId = costcompany.getLong("id");
|
||||
List<QFilter> qFilter = new ArrayList<>();
|
||||
qFilter.add(new QFilter("supplier", QCP.equals, payerid));
|
||||
qFilter.add(new QFilter("fiaccountorg", QCP.equals, companyId));
|
||||
qFilter.add(new QFilter("billstatus", QCP.equals, "C"));
|
||||
formShowParameter.getListFilterParameter().setQFilters(qFilter);
|
||||
}else{
|
||||
this.getView().showTipNotification("费用承担公司或往来单位不能为空");
|
||||
beforeF7SelectEvent.setCancel(true);
|
||||
}
|
||||
if(costcompany!=null){
|
||||
Long companyId = costcompany.getLong("id");
|
||||
qFilter.add(new QFilter("fiaccountorg", QCP.equals, companyId));
|
||||
}
|
||||
qFilter.add(new QFilter("billstatus", QCP.equals, "C"));
|
||||
formShowParameter.getListFilterParameter().setQFilters(qFilter);
|
||||
}else if("zcgj_maintenanceack".equals(propertyName)){
|
||||
DynamicObject billpayerid = (DynamicObject)this.getModel().getValue("billpayerid");
|
||||
DynamicObject costcompany = (DynamicObject)this.getModel().getValue("costcompany");
|
||||
if(billpayerid!=null && costcompany!=null){
|
||||
List<QFilter> qFilter = new ArrayList<>();
|
||||
if(billpayerid!=null){
|
||||
Long payerid = billpayerid.getLong("id");
|
||||
Long companyId = costcompany.getLong("id");
|
||||
List<QFilter> qFilter = new ArrayList<>();
|
||||
qFilter.add(new QFilter("entryentity.zcgj_supplier", QCP.equals, payerid));
|
||||
qFilter.add(new QFilter("zcgj_accountorg", QCP.equals, companyId));
|
||||
qFilter.add(new QFilter("zcgj_maintype", QCP.equals, "10"));
|
||||
qFilter.add(new QFilter("billstatus", QCP.equals, "C"));
|
||||
formShowParameter.getListFilterParameter().setQFilters(qFilter);
|
||||
}else{
|
||||
this.getView().showTipNotification("费用承担公司或往来单位不能为空");
|
||||
beforeF7SelectEvent.setCancel(true);
|
||||
|
||||
}
|
||||
if(costcompany!=null){
|
||||
Long companyId = costcompany.getLong("id");
|
||||
qFilter.add(new QFilter("zcgj_accountorg", QCP.equals, companyId));
|
||||
}
|
||||
|
||||
qFilter.add(new QFilter("zcgj_maintype", QCP.equals, "10"));
|
||||
qFilter.add(new QFilter("billstatus", QCP.equals, "C"));
|
||||
formShowParameter.getListFilterParameter().setQFilters(qFilter);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void itemClick(ItemClickEvent evt) {
|
||||
super.itemClick(evt);
|
||||
//付款计划增行
|
||||
if (evt.getItemKey().equals("addaccount1")) {
|
||||
String zcgjEcpaytype = (String) this.getModel().getValue("zcgj_ecpaytype");
|
||||
String payertype = "";
|
||||
if("DG".equals(zcgjEcpaytype)){
|
||||
payertype = "bd_supplier";
|
||||
}else if("DS".equals(zcgjEcpaytype)){
|
||||
payertype = "er_payeer";
|
||||
}
|
||||
//收款人类型设置默认值
|
||||
DynamicObjectCollection dynamicObjectCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("accountentry");
|
||||
if(!dynamicObjectCollection.isEmpty()){
|
||||
DynamicObject dynamicObject = dynamicObjectCollection.get(dynamicObjectCollection.size() - 1);
|
||||
dynamicObject.set("payertype",payertype);
|
||||
this.getView().updateView("accountentry");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue