出库单废弃成本分解结构必录赋值

This commit is contained in:
xuhaihui 2025-08-29 11:34:56 +08:00
parent 679eaaf77e
commit 1ce97325ce
1 changed files with 30 additions and 30 deletions

View File

@ -24,7 +24,7 @@ import java.util.List;
* 出库单表单插件
* 说明1核算组织由项目中的财务记账组织携带而来
* 2使用设备过滤通过核算组织与使用设备中的使用组织比对而来过滤
* 3科目属性过滤和成本分解结构必录逻辑控制
* 3科目属性过滤和成本分解结构必录逻辑控制废弃
* 4申请人部门赋值过滤
*/
public class MaterialOutBillPlugin extends AbstractBillPlugIn implements BeforeF7SelectListener {
@ -81,19 +81,19 @@ public class MaterialOutBillPlugin extends AbstractBillPlugIn implements BeforeF
}
} else if ("zcgj_accounttype".equals(key)) {
//科目属性
DynamicObjectCollection entryEntityCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity");//出库单分录
boolean hasFL001 = false;
for (DynamicObject entryEntity : entryEntityCollection) {
DynamicObject accountType = entryEntity.getDynamicObject("zcgj_accounttype");//科目属性
if (accountType != null && "FL001".equals(accountType.getString("number"))) {
//科目属性-为生成成本时
hasFL001 = true;
break;
}
}
BasedataEdit edit = this.getView().getControl("procbs");//工作分解结构
edit.setMustInput(hasFL001);// 设置必录
this.getView().updateView("entryentity");//刷新分录
// DynamicObjectCollection entryEntityCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity");//出库单分录
// boolean hasFL001 = false;
// for (DynamicObject entryEntity : entryEntityCollection) {
// DynamicObject accountType = entryEntity.getDynamicObject("zcgj_accounttype");//科目属性
// if (accountType != null && "FL001".equals(accountType.getString("number"))) {
// //科目属性-为生成成本时
// hasFL001 = true;
// break;
// }
// }
// BasedataEdit edit = this.getView().getControl("procbs");//工作分解结构
// edit.setMustInput(hasFL001);// 设置必录
// this.getView().updateView("entryentity");//刷新分录
} else if ("material".equals(key)) {
//资源
ChangeData[] changeSet = e.getChangeSet();
@ -123,22 +123,22 @@ public class MaterialOutBillPlugin extends AbstractBillPlugIn implements BeforeF
public void itemClick(ItemClickEvent evt) {
super.itemClick(evt);
String itemKey = evt.getItemKey();
if (itemKey.equals("deleteentry")) {
//出库单明细删除按钮
DynamicObjectCollection entryEntityCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity");//出库单分录
boolean hasFL001 = false;
for (DynamicObject entryEntity : entryEntityCollection) {
DynamicObject accountType = entryEntity.getDynamicObject("zcgj_accounttype");//科目属性
if (accountType != null && "FL001".equals(accountType.getString("number"))) {
//科目属性-为生成成本时
hasFL001 = true;
break;
}
}
BasedataEdit edit = this.getView().getControl("procbs");//工作分解结构
edit.setMustInput(hasFL001);// 设置必录
this.getView().updateView("entryentity");//刷新分录
}
// if (itemKey.equals("deleteentry")) {
// //出库单明细删除按钮
// DynamicObjectCollection entryEntityCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity");//出库单分录
// boolean hasFL001 = false;
// for (DynamicObject entryEntity : entryEntityCollection) {
// DynamicObject accountType = entryEntity.getDynamicObject("zcgj_accounttype");//科目属性
// if (accountType != null && "FL001".equals(accountType.getString("number"))) {
// //科目属性-为生成成本时
// hasFL001 = true;
// break;
// }
// }
// BasedataEdit edit = this.getView().getControl("procbs");//工作分解结构
// edit.setMustInput(hasFL001);// 设置必录
// this.getView().updateView("entryentity");//刷新分录
// }
}
@Override