diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmePlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmePlugin.java index 833e742..b246267 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmePlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmePlugin.java @@ -128,8 +128,22 @@ 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"); } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleFiConfirmWorkFlowPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleFiConfirmWorkFlowPlugin.java index d2cb6b9..e026e02 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleFiConfirmWorkFlowPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleFiConfirmWorkFlowPlugin.java @@ -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(); - 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"));//费用项目 + 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"));//费用项目 + } + } + } 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"));//工序 } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleInvalidWorkFlowPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleInvalidWorkFlowPlugin.java index ea27cd1..98be8dd 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleInvalidWorkFlowPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleInvalidWorkFlowPlugin.java @@ -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(); - 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"));//费用项目 + 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"));//费用项目 + } + } + } 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"));//工序 } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleReversalWorkFlowPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleReversalWorkFlowPlugin.java index 6cf755e..420a4f5 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleReversalWorkFlowPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/OutContractSettleReversalWorkFlowPlugin.java @@ -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(); - 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"));//费用项目 + 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"));//费用项目 + } + } + } 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"));//工序 } }