private void copyLineItemToPersonnelDetails(BudgetDocument budgetDocument) { for (BudgetPeriod budgetPeriod : budgetDocument.getBudget().getBudgetPeriods()) { if (budgetPeriod.getBudgetLineItems() != null && !budgetPeriod.getBudgetLineItems().isEmpty()) { for (BudgetLineItem budgetLineItem : budgetPeriod.getBudgetLineItems()) { if (budgetLineItem.getBudgetPersonnelDetailsList() != null && !budgetLineItem.getBudgetPersonnelDetailsList().isEmpty()) { for (BudgetPersonnelDetails budgetPersonnelDetails : budgetLineItem.getBudgetPersonnelDetailsList()) { // // budgetPersonnelDetails.setProposalNumber(budgetLineItem.getProposalNumber()); // // budgetPersonnelDetails.setBudgetVersionNumber(budgetLineItem.getBudgetVersionNumber()); budgetPersonnelDetails.setBudgetId(budgetLineItem.getBudgetId()); budgetPersonnelDetails.setBudgetPeriod(budgetLineItem.getBudgetPeriod()); budgetPersonnelDetails.setLineItemNumber(budgetLineItem.getLineItemNumber()); budgetPersonnelDetails.setCostElement(budgetLineItem.getCostElement()); budgetPersonnelDetails.setCostElementBO(budgetLineItem.getCostElementBO()); } } } } } }
/* * This method will set the values to AwardBudgetDetails attributes and * finally returns AwardBudgetDetails Xml object */ private AwardBudgetDetails getAwardBudgetDetails() { AwardBudgetDetails awardBudgetDetails = AwardBudgetDetails.Factory.newInstance(); List<BudgetDetails> budgetDetailsList = new ArrayList<BudgetDetails>(); BudgetDocument budgetDocument = getBudgetDocument(); if (budgetDocument != null) { for (BudgetLineItem budgetLineItem : budgetDocument.getBudget().getBudgetPeriod(0).getBudgetLineItems()) { BudgetDetails budgetDetails = BudgetDetails.Factory.newInstance(); budgetDetails.setAwardNumber(award.getAwardNumber()); budgetDetails.setSequenceNumber(award.getSequenceNumber()); budgetDetails.setLineItemNumber(budgetLineItem.getLineItemNumber()); budgetDetails.setCostElementCode(budgetLineItem.getCostElement()); budgetDetails.setCostElementDescription(budgetLineItem.getCostElementBO().getDescription()); budgetDetails.setLineItemDescription(budgetLineItem.getLineItemDescription()); budgetDetailsList.add(budgetDetails); } } awardBudgetDetails.setBudgetDetailsArray(budgetDetailsList.toArray(new BudgetDetails[0])); return awardBudgetDetails; }