1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.coa.businessobject;
18
19 import java.sql.Date;
20 import java.util.LinkedHashMap;
21
22 import org.apache.commons.lang.StringUtils;
23 import org.kuali.ole.sys.context.SpringContext;
24 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
25 import org.kuali.rice.core.api.util.type.KualiDecimal;
26 import org.kuali.rice.kew.api.doctype.DocumentTypeService;
27 import org.kuali.rice.kew.doctype.bo.DocumentType;
28 import org.kuali.rice.kew.doctype.bo.DocumentTypeEBO;
29 import org.kuali.rice.kim.api.identity.Person;
30 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
31
32
33
34
35 public class AccountDelegateModelDetail extends PersistableBusinessObjectBase implements MutableInactivatable {
36
37 private String chartOfAccountsCode;
38 private String organizationCode;
39 private String accountDelegateModelName;
40 private String accountDelegateUniversalId;
41 private String financialDocumentTypeCode;
42 private KualiDecimal approvalFromThisAmount;
43 private KualiDecimal approvalToThisAmount;
44 private boolean accountDelegatePrimaryRoutingIndicator;
45 private Date accountDelegateStartDate;
46 private boolean active;
47
48 private Chart chartOfAccounts;
49 private DocumentTypeEBO financialSystemDocumentTypeCode;
50 private Person accountDelegate;
51
52
53
54
55 public AccountDelegateModelDetail() {
56 }
57
58 public AccountDelegateModelDetail(AccountDelegateGlobalDetail delegateGlobalDetail) {
59 accountDelegateUniversalId = delegateGlobalDetail.getAccountDelegateUniversalId();
60 accountDelegatePrimaryRoutingIndicator = delegateGlobalDetail.getAccountDelegatePrimaryRoutingIndicator();
61 approvalFromThisAmount = delegateGlobalDetail.getApprovalFromThisAmount();
62 approvalToThisAmount = delegateGlobalDetail.getApprovalToThisAmount();
63 accountDelegateStartDate = delegateGlobalDetail.getAccountDelegateStartDate();
64 financialDocumentTypeCode = delegateGlobalDetail.getFinancialDocumentTypeCode();
65 }
66
67
68
69
70
71
72 public String getChartOfAccountsCode() {
73 return chartOfAccountsCode;
74 }
75
76
77
78
79
80
81 public void setChartOfAccountsCode(String chartOfAccountsCode) {
82 this.chartOfAccountsCode = chartOfAccountsCode;
83 }
84
85
86
87
88
89
90
91 public String getOrganizationCode() {
92 return organizationCode;
93 }
94
95
96
97
98
99
100 public void setOrganizationCode(String organizationCode) {
101 this.organizationCode = organizationCode;
102 }
103
104
105
106
107
108
109
110 public String getAccountDelegateModelName() {
111 return accountDelegateModelName;
112 }
113
114
115
116
117
118
119 public void setAccountDelegateModelName(String organizationRoutingModelName) {
120 this.accountDelegateModelName = organizationRoutingModelName;
121 }
122
123
124
125
126
127
128
129 public String getAccountDelegateUniversalId() {
130 return accountDelegateUniversalId;
131 }
132
133
134
135
136
137
138 public void setAccountDelegateUniversalId(String accountDelegateUniversalId) {
139 this.accountDelegateUniversalId = accountDelegateUniversalId;
140 }
141
142
143
144
145
146
147
148 public Person getAccountDelegate() {
149 accountDelegate = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(accountDelegateUniversalId, accountDelegate);
150 return accountDelegate;
151 }
152
153
154
155
156
157
158 public void setAccountDelegate(Person accountDelegate) {
159 this.accountDelegate = accountDelegate;
160 }
161
162
163
164
165
166
167 public String getFinancialDocumentTypeCode() {
168 return financialDocumentTypeCode;
169 }
170
171
172
173
174
175
176 public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
177 this.financialDocumentTypeCode = financialDocumentTypeCode;
178 }
179
180
181
182
183
184 public DocumentTypeEBO getFinancialSystemDocumentTypeCode() {
185 if ( StringUtils.isBlank( financialDocumentTypeCode ) ) {
186 financialSystemDocumentTypeCode = null;
187 } else {
188 if ( financialSystemDocumentTypeCode == null || !StringUtils.equals(financialDocumentTypeCode, financialSystemDocumentTypeCode.getName() ) ) {
189 org.kuali.rice.kew.api.doctype.DocumentType temp = SpringContext.getBean(DocumentTypeService.class).getDocumentTypeByName(financialDocumentTypeCode);
190 if ( temp != null ) {
191 financialSystemDocumentTypeCode = DocumentType.from( temp );
192 } else {
193 financialSystemDocumentTypeCode = null;
194 }
195 }
196 }
197 return financialSystemDocumentTypeCode;
198 }
199
200
201
202
203
204
205 public KualiDecimal getApprovalFromThisAmount() {
206 return approvalFromThisAmount;
207 }
208
209
210
211
212
213
214 public void setApprovalFromThisAmount(KualiDecimal approvalFromThisAmount) {
215 this.approvalFromThisAmount = approvalFromThisAmount;
216 }
217
218
219
220
221
222
223
224 public KualiDecimal getApprovalToThisAmount() {
225 return approvalToThisAmount;
226 }
227
228
229
230
231
232
233 public void setApprovalToThisAmount(KualiDecimal approvalToThisAmount) {
234 this.approvalToThisAmount = approvalToThisAmount;
235 }
236
237
238
239
240
241
242
243 public boolean getAccountDelegatePrimaryRoutingIndicator() {
244 return accountDelegatePrimaryRoutingIndicator;
245 }
246
247
248
249
250
251
252 public void setAccountDelegatePrimaryRoutingIndicator(boolean accountDelegatePrimaryRoutingCode) {
253 this.accountDelegatePrimaryRoutingIndicator = accountDelegatePrimaryRoutingCode;
254 }
255
256
257
258
259
260
261
262 public Date getAccountDelegateStartDate() {
263 return accountDelegateStartDate;
264 }
265
266
267
268
269
270
271 public void setAccountDelegateStartDate(Date accountDelegateStartDate) {
272 this.accountDelegateStartDate = accountDelegateStartDate;
273 }
274
275
276
277
278
279
280 @Override
281 public boolean isActive() {
282 return active;
283 }
284
285
286
287
288
289
290 public void setActive(boolean active) {
291 this.active = active;
292 }
293
294
295
296
297
298
299 public Chart getChartOfAccounts() {
300 return chartOfAccounts;
301 }
302
303
304
305
306
307
308
309 public void setChartOfAccounts(Chart chartOfAccounts) {
310 this.chartOfAccounts = chartOfAccounts;
311 }
312
313
314
315
316 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
317 LinkedHashMap m = new LinkedHashMap();
318 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
319 m.put("organizationCode", this.organizationCode);
320 m.put("accountDelegateModelName", this.accountDelegateModelName);
321 m.put("accountDelegateUniversalId", this.accountDelegateUniversalId);
322 m.put("financialDocumentTypeCode", this.financialDocumentTypeCode);
323 return m;
324 }
325 }
326