支出财务确认单费用项目分录新增相关逻辑

This commit is contained in:
xuhaihui 2026-01-12 17:11:12 +08:00
parent 60bd72d8af
commit c8989505df
4 changed files with 108 additions and 34 deletions

View File

@ -128,10 +128,24 @@ public class OutContractFinaceConfirmePlugin extends AbstractBillPlugIn impleme
expenseItemEntry.set("zcgj_expenseitemrem", dynamicObject.getString("remark"));//费用说明
expenseItemEntry.set("zcgj_cbs", dynamicObject.getDynamicObject("itemcbs"));//工序
}
this.getView().updateView("zcgj_expenseitementry");
} else {
for (DynamicObject itemEntry : itementry) {
DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊
for (DynamicObject processAllocEntity : processAllocEntityCollection) {
DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew();
NewExpenseItemEntry.set("zcgj_cbs", processAllocEntity.get("zcgj_pa_process"));//工序
NewExpenseItemEntry.set("zcgj_amountsum", processAllocEntity.get("zcgj_pa_amount"));//价税合计
NewExpenseItemEntry.set("zcgj_expenseitemamt", processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额
NewExpenseItemEntry.set("zcgj_rateval", processAllocEntity.get("zcgj_rateval"));//税率%
NewExpenseItemEntry.set("zcgj_taxamount", processAllocEntity.get("zcgj_taxamt"));//税额
NewExpenseItemEntry.set("zcgj_expenseitemrem", processAllocEntity.get("zcgj_pa_remark"));//费用说明
NewExpenseItemEntry.set("zcgj_expenseitem", processAllocEntity.get("zcgj_expenseitem"));//费用项目
}
}
}
this.getView().updateView("zcgj_expenseitementry");
}
}
public void propertyChanged(PropertyChangedArgs e) {
String name = e.getProperty().getName();

View File

@ -2,6 +2,7 @@ package zcgj.zcdev.zcdev.pr.plugin.workflow;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.operate.result.OperationResult;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
@ -104,19 +105,38 @@ public class OutContractSettleFiConfirmWorkFlowPlugin implements IWorkflowPlugin
outFinaceconfirm.set("zcgj_isprepay", "20");//冲销预付-
}
DynamicObject contract = outContractSettle.getDynamicObject("contract");//合同名称
String priceType = contract.getString("zcgj_pricetype");//计价方式
DynamicObjectCollection expenseItemEntryCollection = outFinaceconfirm.getDynamicObjectCollection("zcgj_expenseitementry");//支出财务确认单-费用项目分录
expenseItemEntryCollection.clear();
if (StringUtils.equals(priceType, "gddj")) {
//计价方式为综合单价
for (DynamicObject itemEntry : itementry) {
DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊
for (DynamicObject processAllocEntity : processAllocEntityCollection) {
DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew();
NewExpenseItemEntry.set("zcgj_cbs",processAllocEntity.get("zcgj_pa_process"));//工序
NewExpenseItemEntry.set("zcgj_amountsum",processAllocEntity.get("zcgj_pa_amount"));//价税合计
NewExpenseItemEntry.set("zcgj_expenseitemamt",processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额
NewExpenseItemEntry.set("zcgj_rateval",processAllocEntity.get("zcgj_rateval"));//税率%
NewExpenseItemEntry.set("zcgj_taxamount",processAllocEntity.get("zcgj_taxamt"));//税额
NewExpenseItemEntry.set("zcgj_expenseitemrem",processAllocEntity.get("zcgj_pa_remark"));//费用说明
NewExpenseItemEntry.set("zcgj_expenseitem",processAllocEntity.get("zcgj_expenseitem"));//费用项目
NewExpenseItemEntry.set("zcgj_cbs", processAllocEntity.get("zcgj_pa_process"));//工序
NewExpenseItemEntry.set("zcgj_amountsum", processAllocEntity.get("zcgj_pa_amount"));//价税合计
NewExpenseItemEntry.set("zcgj_expenseitemamt", processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额
NewExpenseItemEntry.set("zcgj_rateval", processAllocEntity.get("zcgj_rateval"));//税率%
NewExpenseItemEntry.set("zcgj_taxamount", processAllocEntity.get("zcgj_taxamt"));//税额
NewExpenseItemEntry.set("zcgj_expenseitemrem", processAllocEntity.get("zcgj_pa_remark"));//费用说明
NewExpenseItemEntry.set("zcgj_expenseitem", processAllocEntity.get("zcgj_expenseitem"));//费用项目
}
}
} else {
for (DynamicObject dynamicObject : itementry) {
BigDecimal ofTaxAmount = dynamicObject.getBigDecimal("oftaxamount");
if (ofTaxAmount.compareTo(BigDecimal.ZERO) == 0) {
continue;
}
DynamicObject expenseItemEntry = expenseItemEntryCollection.addNew();
expenseItemEntry.set("zcgj_amountsum", ofTaxAmount);//价税合计
expenseItemEntry.set("zcgj_expenseitemamt", dynamicObject.getBigDecimal("amount"));//费用不含税金额
expenseItemEntry.set("zcgj_rateval", dynamicObject.getBigDecimal("rate"));//税率%
expenseItemEntry.set("zcgj_taxamount", dynamicObject.getBigDecimal("taxamt"));//税额
expenseItemEntry.set("zcgj_expenseitemrem", dynamicObject.getString("remark"));//费用说明
expenseItemEntry.set("zcgj_cbs", dynamicObject.getDynamicObject("itemcbs"));//工序
}
}

View File

@ -2,6 +2,7 @@ package zcgj.zcdev.zcdev.pr.plugin.workflow;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.operate.result.OperationResult;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
@ -100,19 +101,38 @@ public class OutContractSettleInvalidWorkFlowPlugin implements IWorkflowPlugin {
outFinaceconfirm.set("zcgj_isprepay", "20");//冲销预付-
}
DynamicObject contract = outContractSettle.getDynamicObject("contract");//合同名称
String priceType = contract.getString("zcgj_pricetype");//计价方式
DynamicObjectCollection expenseItemEntryCollection = outFinaceconfirm.getDynamicObjectCollection("zcgj_expenseitementry");//支出财务确认单-费用项目分录
expenseItemEntryCollection.clear();
if (StringUtils.equals(priceType, "gddj")) {
//计价方式为综合单价
for (DynamicObject itemEntry : itementry) {
DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊
for (DynamicObject processAllocEntity : processAllocEntityCollection) {
DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew();
NewExpenseItemEntry.set("zcgj_cbs",processAllocEntity.get("zcgj_pa_process"));//工序
NewExpenseItemEntry.set("zcgj_amountsum",processAllocEntity.get("zcgj_pa_amount"));//价税合计
NewExpenseItemEntry.set("zcgj_expenseitemamt",processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额
NewExpenseItemEntry.set("zcgj_rateval",processAllocEntity.get("zcgj_rateval"));//税率%
NewExpenseItemEntry.set("zcgj_taxamount",processAllocEntity.get("zcgj_taxamt"));//税额
NewExpenseItemEntry.set("zcgj_expenseitemrem",processAllocEntity.get("zcgj_pa_remark"));//费用说明
NewExpenseItemEntry.set("zcgj_expenseitem",processAllocEntity.get("zcgj_expenseitem"));//费用项目
NewExpenseItemEntry.set("zcgj_cbs", processAllocEntity.get("zcgj_pa_process"));//工序
NewExpenseItemEntry.set("zcgj_amountsum", processAllocEntity.get("zcgj_pa_amount"));//价税合计
NewExpenseItemEntry.set("zcgj_expenseitemamt", processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额
NewExpenseItemEntry.set("zcgj_rateval", processAllocEntity.get("zcgj_rateval"));//税率%
NewExpenseItemEntry.set("zcgj_taxamount", processAllocEntity.get("zcgj_taxamt"));//税额
NewExpenseItemEntry.set("zcgj_expenseitemrem", processAllocEntity.get("zcgj_pa_remark"));//费用说明
NewExpenseItemEntry.set("zcgj_expenseitem", processAllocEntity.get("zcgj_expenseitem"));//费用项目
}
}
} else {
for (DynamicObject dynamicObject : itementry) {
BigDecimal ofTaxAmount = dynamicObject.getBigDecimal("oftaxamount");
if (ofTaxAmount.compareTo(BigDecimal.ZERO) == 0) {
continue;
}
DynamicObject expenseItemEntry = expenseItemEntryCollection.addNew();
expenseItemEntry.set("zcgj_amountsum", ofTaxAmount);//价税合计
expenseItemEntry.set("zcgj_expenseitemamt", dynamicObject.getBigDecimal("amount"));//费用不含税金额
expenseItemEntry.set("zcgj_rateval", dynamicObject.getBigDecimal("rate"));//税率%
expenseItemEntry.set("zcgj_taxamount", dynamicObject.getBigDecimal("taxamt"));//税额
expenseItemEntry.set("zcgj_expenseitemrem", dynamicObject.getString("remark"));//费用说明
expenseItemEntry.set("zcgj_cbs", dynamicObject.getDynamicObject("itemcbs"));//工序
}
}

View File

@ -2,6 +2,7 @@ package zcgj.zcdev.zcdev.pr.plugin.workflow;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.operate.result.OperationResult;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
@ -148,19 +149,38 @@ public class OutContractSettleReversalWorkFlowPlugin implements IWorkflowPlugin
outFinaceconfirm.set("zcgj_isprepay", "20");//冲销预付-
}
DynamicObject contract = outContractSettle.getDynamicObject("contract");//合同名称
String priceType = contract.getString("zcgj_pricetype");//计价方式
DynamicObjectCollection expenseItemEntryCollection = outFinaceconfirm.getDynamicObjectCollection("zcgj_expenseitementry");//支出财务确认单-费用项目分录
expenseItemEntryCollection.clear();
if (StringUtils.equals(priceType, "gddj")) {
//计价方式为综合单价
for (DynamicObject itemEntry : itementry) {
DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊
for (DynamicObject processAllocEntity : processAllocEntityCollection) {
DynamicObject NewExpenseItemEntry = expenseItemEntryCollection.addNew();
NewExpenseItemEntry.set("zcgj_cbs",processAllocEntity.get("zcgj_pa_process"));//工序
NewExpenseItemEntry.set("zcgj_amountsum",processAllocEntity.get("zcgj_pa_amount"));//价税合计
NewExpenseItemEntry.set("zcgj_expenseitemamt",processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额
NewExpenseItemEntry.set("zcgj_rateval",processAllocEntity.get("zcgj_rateval"));//税率%
NewExpenseItemEntry.set("zcgj_taxamount",processAllocEntity.get("zcgj_taxamt"));//税额
NewExpenseItemEntry.set("zcgj_expenseitemrem",processAllocEntity.get("zcgj_pa_remark"));//费用说明
NewExpenseItemEntry.set("zcgj_expenseitem",processAllocEntity.get("zcgj_expenseitem"));//费用项目
NewExpenseItemEntry.set("zcgj_cbs", processAllocEntity.get("zcgj_pa_process"));//工序
NewExpenseItemEntry.set("zcgj_amountsum", processAllocEntity.get("zcgj_pa_amount"));//价税合计
NewExpenseItemEntry.set("zcgj_expenseitemamt", processAllocEntity.get("zcgj_amountnotax"));//费用不含税金额
NewExpenseItemEntry.set("zcgj_rateval", processAllocEntity.get("zcgj_rateval"));//税率%
NewExpenseItemEntry.set("zcgj_taxamount", processAllocEntity.get("zcgj_taxamt"));//税额
NewExpenseItemEntry.set("zcgj_expenseitemrem", processAllocEntity.get("zcgj_pa_remark"));//费用说明
NewExpenseItemEntry.set("zcgj_expenseitem", processAllocEntity.get("zcgj_expenseitem"));//费用项目
}
}
} else {
for (DynamicObject dynamicObject : itementry) {
BigDecimal ofTaxAmount = dynamicObject.getBigDecimal("oftaxamount");
if (ofTaxAmount.compareTo(BigDecimal.ZERO) == 0) {
continue;
}
DynamicObject expenseItemEntry = expenseItemEntryCollection.addNew();
expenseItemEntry.set("zcgj_amountsum", ofTaxAmount);//价税合计
expenseItemEntry.set("zcgj_expenseitemamt", dynamicObject.getBigDecimal("amount"));//费用不含税金额
expenseItemEntry.set("zcgj_rateval", dynamicObject.getBigDecimal("rate"));//税率%
expenseItemEntry.set("zcgj_taxamount", dynamicObject.getBigDecimal("taxamt"));//税额
expenseItemEntry.set("zcgj_expenseitemrem", dynamicObject.getString("remark"));//费用说明
expenseItemEntry.set("zcgj_cbs", dynamicObject.getDynamicObject("itemcbs"));//工序
}
}