1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.document.service.impl;
17
18 import org.kuali.ole.coa.businessobject.Account;
19 import org.kuali.ole.coa.businessobject.ObjectCode;
20 import org.kuali.ole.gl.businessobject.Balance;
21 import org.kuali.ole.gl.dataaccess.BalanceDao;
22 import org.kuali.ole.sys.document.service.AccountPresenceService;
23 import org.kuali.ole.sys.service.NonTransactional;
24
25
26
27
28
29
30
31 @NonTransactional
32 public class AccountPresenceServiceImpl implements AccountPresenceService {
33 private BalanceDao balanceDao;
34
35
36
37
38
39
40
41
42
43
44 public boolean isObjectCodeBudgetedForAccountPresence(Account account, ObjectCode objectCode) {
45 boolean objectCodeValid = true;
46
47
48
49
50 if (account.isFinancialObjectivePrsctrlIndicator()) {
51
52
53
54
55
56 Balance foundBalance = (Balance) balanceDao.getCurrentBudgetForObjectCode(objectCode.getUniversityFiscalYear(), account.getChartOfAccountsCode(), account.getAccountNumber(), objectCode.getFinancialObjectCode());
57
58
59 if (foundBalance == null) {
60 foundBalance = (Balance) balanceDao.getCurrentBudgetForObjectCode(objectCode.getUniversityFiscalYear(), account.getChartOfAccountsCode(), account.getAccountNumber(), objectCode.getFinancialObjectLevel().getConsolidatedObjectCode());
61
62
63 if (foundBalance == null) {
64 foundBalance = (Balance) balanceDao.getCurrentBudgetForObjectCode(objectCode.getUniversityFiscalYear(), account.getChartOfAccountsCode(), account.getAccountNumber(), objectCode.getFinancialObjectLevelCode());
65
66
67 if (foundBalance == null) {
68 objectCodeValid = false;
69 }
70 }
71 }
72 }
73
74 return objectCodeValid;
75 }
76
77
78
79
80
81
82 public BalanceDao getBalanceDao() {
83 return balanceDao;
84 }
85
86
87
88
89
90
91 public void setBalanceDao(BalanceDao balanceDao) {
92 this.balanceDao = balanceDao;
93 }
94 }