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 ee4d29e..77c8bcb 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 @@ -30,7 +30,7 @@ public class OutContractSettleFiConfirmWorkFlowPlugin implements IWorkflowPlugin //如果时冲销单据 //生成支出财务确认单 start //收入合同结算 - DynamicObject outFinaceconfirm =BusinessDataServiceHelper.newDynamicObject("zcgj_ec_out_finaceconfirm"); + DynamicObject outFinaceconfirm =BusinessDataServiceHelper.newDynamicObject("zcgj_ec_out_finaceconfirm");//支出财务确认单 outFinaceconfirm.set("zcgj_ec_out_contract_sett",outContractSettle.getLong("id")); outFinaceconfirm.set("zcgj_ec_out_contract_name",outContractSettle.getString("billname")); @@ -76,6 +76,22 @@ public class OutContractSettleFiConfirmWorkFlowPlugin implements IWorkflowPlugin outFinaceconfirm.set("zcgj_oftaxamount_all",oftaxamountAll); outFinaceconfirm.set("zcgj_amount_all",amountAll); outFinaceconfirm.set("zcgj_taxamt_all",taxamtAll); + + 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"));//费用说明 + } + } + SaveServiceHelper.saveOperate("zcgj_ec_out_finaceconfirm", new DynamicObject[]{outFinaceconfirm}, null);//支出合同实体 //生成支出财务确认单 end } 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 9a807e6..5fc1632 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 @@ -76,6 +76,22 @@ public class OutContractSettleInvalidWorkFlowPlugin implements IWorkflowPlugin { outFinaceconfirm.set("zcgj_oftaxamount_all",oftaxamountAll); outFinaceconfirm.set("zcgj_amount_all",amountAll); outFinaceconfirm.set("zcgj_taxamt_all",taxamtAll); + + 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"));//费用说明 + } + } + OperationResult zcgjEcOutFinaceconfirm = SaveServiceHelper.saveOperate("zcgj_ec_out_finaceconfirm", new DynamicObject[]{outFinaceconfirm}, null);//支出合同实体 if(zcgjEcOutFinaceconfirm.isSuccess()){ String sourceBillId = outContractSettle.getString("zcgj_invalidbillid"); 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 dadff39..56f65a2 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 @@ -124,6 +124,21 @@ public class OutContractSettleReversalWorkFlowPlugin implements IWorkflowPlugin item.set("zcgj_taxamt",dynamicObject.getBigDecimal("taxamt")); item.set("zcgj_remark",dynamicObject.getString("remark")); } + + 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"));//费用说明 + } + } SaveServiceHelper.saveOperate("zcgj_ec_out_finaceconfirm", new DynamicObject[]{outFinaceconfirm}, null);//支出合同实体 //生成支出财务确认单 end