1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.businessobject;
17
18 import java.io.Serializable;
19 import java.util.LinkedHashMap;
20
21 import org.kuali.ole.coa.businessobject.Account;
22 import org.kuali.rice.core.api.util.type.KualiDecimal;
23 import org.kuali.rice.krad.bo.TransientBusinessObjectBase;
24
25
26
27
28
29
30 public class AccountResponsibility extends TransientBusinessObjectBase implements Serializable {
31
32 private static final long serialVersionUID = 3101634819409319387L;
33 public static final int FISCAL_OFFICER_RESPONSIBILITY = 1;
34 public static final int DELEGATED_RESPONSIBILITY = 2;
35
36 private Account account;
37 private int accountResponsibilityType;
38 private KualiDecimal minimumDollarAmount;
39 private KualiDecimal maximumDollarAmount;
40 private String documentTypeId;
41
42 public AccountResponsibility() {
43 }
44
45
46
47
48
49
50
51
52
53 public AccountResponsibility(int accountResponsibilityType, KualiDecimal minimumDollarAmount, KualiDecimal maximumDollarAmount, String documentTypeId, Account account) {
54 if (!isValidResponsibilityType(accountResponsibilityType)) {
55 throw new IllegalArgumentException("invalid accountResponsibilityType passed in");
56 }
57 this.accountResponsibilityType = accountResponsibilityType;
58 this.minimumDollarAmount = minimumDollarAmount;
59 this.maximumDollarAmount = maximumDollarAmount;
60 this.documentTypeId = documentTypeId;
61 this.account = account;
62 }
63
64 private boolean isValidResponsibilityType(int type) {
65 return type == FISCAL_OFFICER_RESPONSIBILITY || type == DELEGATED_RESPONSIBILITY;
66 }
67
68
69 public Account getAccount() {
70 return account;
71 }
72
73 public void setAccount(Account account) {
74 this.account = account;
75 }
76
77 public int getAccountResponsibilityType() {
78 return accountResponsibilityType;
79 }
80
81 public void setAccountResponsibilityType(int accountResponsibilityType) {
82 this.accountResponsibilityType = accountResponsibilityType;
83 }
84
85 public String getDocumentTypeId() {
86 return documentTypeId;
87 }
88
89 public void setDocumentTypeId(String documentTypeId) {
90 this.documentTypeId = documentTypeId;
91 }
92
93 public KualiDecimal getMaximumDollarAmount() {
94 return maximumDollarAmount;
95 }
96
97 public void setMaximumDollarAmount(KualiDecimal maximumDollarAmount) {
98 this.maximumDollarAmount = maximumDollarAmount;
99 }
100
101 public KualiDecimal getMinimumDollarAmount() {
102 return minimumDollarAmount;
103 }
104
105 public void setMinimumDollarAmount(KualiDecimal minimumDollarAmount) {
106 this.minimumDollarAmount = minimumDollarAmount;
107 }
108
109
110
111
112
113 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
114 LinkedHashMap m = new LinkedHashMap();
115 if (account != null) {
116 m.put("accountNumber", this.account.getAccountNumber());
117 }
118 m.put("accountResponsibilityType", this.accountResponsibilityType);
119 m.put("minimumDollarAmount", this.minimumDollarAmount);
120 m.put("maximumDollarAmount", this.maximumDollarAmount);
121 m.put("documentTypeId", this.documentTypeId);
122 return m;
123 }
124
125
126 }