protected ScaleTwoDecimal getTotalCost ( BudgetModularContract budgetModular ) { ScaleTwoDecimal totalCost = ScaleTwoDecimal . ZERO ; if ( budgetModular . getTotalDirectCost ( ) != null ) { totalCost = budgetModular . getTotalDirectCost ( ) ; } for ( BudgetModularIdcContract budgetModularIdc : budgetModular . getBudgetModularIdcs ( ) ) { if ( budgetModularIdc . getFundsRequested ( ) != null ) { totalCost = totalCost . add ( budgetModularIdc . getFundsRequested ( ) ) ; } } return totalCost ; }
This method is used to get total cost as sum of totalDirectCost and total sum of fundRequested .