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