private BudgetSummary getBudgetSummary() {
        BudgetSummary budgetSummary = BudgetSummary.Factory.newInstance();
        SummaryLineItem[] summaryLineItemArray = new SummaryLineItem[1];
        SummaryLineItem summaryLineItem = SummaryLineItem.Factory.newInstance();
        boolean hasBudgetLineItem = false;
        
        if (pdDoc.getDevelopmentProposal().getS2sOpportunity() != null && pdDoc.getDevelopmentProposal().getS2sOpportunity().getS2sSubmissionType() != null) {
            summaryLineItem.setActivityTitle(pdDoc.getDevelopmentProposal().getS2sOpportunity().getOpportunityTitle());
            if (pdDoc.getDevelopmentProposal().getS2sOpportunity().getCfdaNumber() != null) {
                summaryLineItem.setCFDANumber(pdDoc.getDevelopmentProposal().getS2sOpportunity().getCfdaNumber());
            }
        }
        if (budget != null) {
            ScaleTwoDecimal fedNonFedCost = budget.getTotalCost();
            ScaleTwoDecimal costSharingAmount = ScaleTwoDecimal.ZERO;

            for (BudgetPeriodContract budgetPeriod : budget.getBudgetPeriods()) {
                for (BudgetLineItemContract lineItem : budgetPeriod.getBudgetLineItems()) {
                    hasBudgetLineItem = true;
                    if (budget.getSubmitCostSharingFlag() && lineItem.getSubmitCostSharingFlag()) {
                        costSharingAmount =  costSharingAmount.add(lineItem.getCostSharingAmount());
                        List<? extends BudgetLineItemCalculatedAmountContract> calculatedAmounts = lineItem.getBudgetLineItemCalculatedAmounts();
                        for (BudgetLineItemCalculatedAmountContract budgetLineItemCalculatedAmount : calculatedAmounts) {
                             costSharingAmount =  costSharingAmount.add(budgetLineItemCalculatedAmount.getCalculatedCostSharing());
                        }
                        
                    }
                }
            }
            if(!hasBudgetLineItem && budget.getSubmitCostSharingFlag()){
                costSharingAmount = budget.getCostSharingAmount();      
            }
            fedNonFedCost = fedNonFedCost.add(costSharingAmount);
            summaryLineItem.setBudgetFederalNewOrRevisedAmount(budget.getTotalCost().bigDecimalValue());
            summaryLineItem.setBudgetNonFederalNewOrRevisedAmount(costSharingAmount.bigDecimalValue());
            summaryLineItem.setBudgetTotalNewOrRevisedAmount(fedNonFedCost.bigDecimalValue());
            summaryLineItemArray[0] = summaryLineItem;
            budgetSummary.setSummaryLineItemArray(summaryLineItemArray);

            SummaryTotals summaryTotals = SummaryTotals.Factory.newInstance();
            summaryTotals.setBudgetFederalNewOrRevisedAmount(budget.getTotalCost().bigDecimalValue());
            summaryTotals.setBudgetNonFederalNewOrRevisedAmount(costSharingAmount.bigDecimalValue());
            summaryTotals.setBudgetTotalNewOrRevisedAmount(fedNonFedCost.bigDecimalValue());
            budgetSummary.setSummaryTotals(summaryTotals);
        }

        return budgetSummary;
    }
private BudgetSummary getBudgetSummary ( ) { BudgetSummary budgetSummary = BudgetSummary . Factory . newInstance ( ) ; SummaryLineItem [ ] summaryLineItemArray = new SummaryLineItem [ 1 ] ; SummaryLineItem summaryLineItem = SummaryLineItem . Factory . newInstance ( ) ; boolean hasBudgetLineItem = false ; if ( pdDoc . getDevelopmentProposal ( ) . getS2sOpportunity ( ) != null && pdDoc . getDevelopmentProposal ( ) . getS2sOpportunity ( ) . getS2sSubmissionType ( ) != null ) { summaryLineItem . setActivityTitle ( pdDoc . getDevelopmentProposal ( ) . getS2sOpportunity ( ) . getOpportunityTitle ( ) ) ; if ( pdDoc . getDevelopmentProposal ( ) . getS2sOpportunity ( ) . getCfdaNumber ( ) != null ) { summaryLineItem . setCFDANumber ( pdDoc . getDevelopmentProposal ( ) . getS2sOpportunity ( ) . getCfdaNumber ( ) ) ; } } if ( budget != null ) { ScaleTwoDecimal fedNonFedCost = budget . getTotalCost ( ) ; ScaleTwoDecimal costSharingAmount = ScaleTwoDecimal . ZERO ; for ( BudgetPeriodContract budgetPeriod : budget . getBudgetPeriods ( ) ) { for ( BudgetLineItemContract lineItem : budgetPeriod . getBudgetLineItems ( ) ) { hasBudgetLineItem = true ; if ( budget . getSubmitCostSharingFlag ( ) && lineItem . getSubmitCostSharingFlag ( ) ) { costSharingAmount = costSharingAmount . add ( lineItem . getCostSharingAmount ( ) ) ; List < ? extends BudgetLineItemCalculatedAmountContract > calculatedAmounts = lineItem . getBudgetLineItemCalculatedAmounts ( ) ; for ( BudgetLineItemCalculatedAmountContract budgetLineItemCalculatedAmount : calculatedAmounts ) { costSharingAmount = costSharingAmount . add ( budgetLineItemCalculatedAmount . getCalculatedCostSharing ( ) ) ; } } } } if ( ! hasBudgetLineItem && budget . getSubmitCostSharingFlag ( ) ) { costSharingAmount = budget . getCostSharingAmount ( ) ; } fedNonFedCost = fedNonFedCost . add ( costSharingAmount ) ; summaryLineItem . setBudgetFederalNewOrRevisedAmount ( budget . getTotalCost ( ) . bigDecimalValue ( ) ) ; summaryLineItem . setBudgetNonFederalNewOrRevisedAmount ( costSharingAmount . bigDecimalValue ( ) ) ; summaryLineItem . setBudgetTotalNewOrRevisedAmount ( fedNonFedCost . bigDecimalValue ( ) ) ; summaryLineItemArray [ 0 ] = summaryLineItem ; budgetSummary . setSummaryLineItemArray ( summaryLineItemArray ) ; SummaryTotals summaryTotals = SummaryTotals . Factory . newInstance ( ) ; summaryTotals . setBudgetFederalNewOrRevisedAmount ( budget . getTotalCost ( ) . bigDecimalValue ( ) ) ; summaryTotals . setBudgetNonFederalNewOrRevisedAmount ( costSharingAmount . bigDecimalValue ( ) ) ; summaryTotals . setBudgetTotalNewOrRevisedAmount ( fedNonFedCost . bigDecimalValue ( ) ) ; budgetSummary . setSummaryTotals ( summaryTotals ) ; } return budgetSummary ; }
This method gives the information of BudgetSummary which consists of SummaryLineItem, SummaryTotals

@return BudgetSummary budget summary total.