1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.kuali.coeus.s2sgen.impl.budget;
20
21 import org.kuali.coeus.propdev.api.budget.ProposalDevelopmentBudgetExtContract;
22 import org.kuali.coeus.propdev.api.core.DevelopmentProposalContract;
23 import org.springframework.stereotype.Component;
24
25 @Component("s2SCommonBudgetService")
26 public class S2SCommonBudgetServiceImpl implements S2SCommonBudgetService {
27 @Override
28 public ProposalDevelopmentBudgetExtContract getBudget(DevelopmentProposalContract developmentProposal) {
29 if (developmentProposal == null) {
30 throw new IllegalArgumentException("developmentProposal is null");
31 }
32
33 final ProposalDevelopmentBudgetExtContract finalBudget = developmentProposal.getFinalBudget();
34 return finalBudget != null ? finalBudget : developmentProposal.getLatestBudget();
35 }
36 }