001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: /*
017: * Created on Jun 22, 2004
018: *
019: */
020: package org.kuali.module.pdp.xml;
021:
022: import java.io.Serializable;
023: import java.math.BigDecimal;
024:
025: import org.kuali.module.pdp.bo.PaymentAccountDetail;
026:
027: /**
028: * @author jsissom
029: */
030: public class XmlAccounting implements Serializable {
031: private String coa_cd;
032: private String account_nbr;
033: private String sub_account_nbr;
034: private String object_cd;
035: private String sub_object_cd;
036: private String org_ref_id;
037: private String project_cd;
038: private BigDecimal amount;
039:
040: public XmlAccounting() {
041: }
042:
043: public void setField(String name, String value) {
044: // Don't need to set an empty value
045: if ((value == null) || (value.length() == 0)) {
046: return;
047: }
048:
049: if ("coa_cd".equals(name)) {
050: setCoa_cd(value.toUpperCase());
051: } else if ("account_nbr".equals(name)) {
052: setAccount_nbr(value);
053: } else if ("sub_account_nbr".equals(name)) {
054: setSub_account_nbr(value);
055: } else if ("object_cd".equals(name)) {
056: setObject_cd(value);
057: } else if ("sub_object_cd".equals(name)) {
058: setSub_object_cd(value);
059: } else if ("org_ref_id".equals(name)) {
060: setOrg_ref_id(value);
061: } else if ("project_cd".equals(name)) {
062: setProject_cd(value);
063: } else if ("amount".equals(name)) {
064: setAmount(new BigDecimal(value.trim()));
065: }
066: }
067:
068: public PaymentAccountDetail getPaymentAccountDetail() {
069: PaymentAccountDetail pad = new PaymentAccountDetail();
070: pad.setFinChartCode(coa_cd);
071: pad.setAccountNbr(account_nbr);
072: pad.setSubAccountNbr(sub_account_nbr);
073: pad.setFinObjectCode(object_cd);
074: pad.setFinSubObjectCode(sub_object_cd);
075: pad.setOrgReferenceId(org_ref_id);
076: pad.setProjectCode(project_cd);
077: pad.setAccountNetAmount(amount);
078: return pad;
079: }
080:
081: /**
082: * @return Returns the account_nbr.
083: */
084: public String getAccount_nbr() {
085: return account_nbr;
086: }
087:
088: /**
089: * @param account_nbr The account_nbr to set.
090: */
091: public void setAccount_nbr(String account_nbr) {
092: this .account_nbr = account_nbr;
093: }
094:
095: /**
096: * @return Returns the amount.
097: */
098: public BigDecimal getAmount() {
099: return amount;
100: }
101:
102: /**
103: * @param amount The amount to set.
104: */
105: public void setAmount(BigDecimal amount) {
106: this .amount = amount;
107: }
108:
109: /**
110: * @return Returns the coa_cd.
111: */
112: public String getCoa_cd() {
113: return coa_cd;
114: }
115:
116: /**
117: * @param coa_cd The coa_cd to set.
118: */
119: public void setCoa_cd(String coa_cd) {
120: this .coa_cd = coa_cd;
121: }
122:
123: /**
124: * @return Returns the object_cd.
125: */
126: public String getObject_cd() {
127: return object_cd;
128: }
129:
130: /**
131: * @param object_cd The object_cd to set.
132: */
133: public void setObject_cd(String object_cd) {
134: this .object_cd = object_cd;
135: }
136:
137: /**
138: * @return Returns the org_ref_id.
139: */
140: public String getOrg_ref_id() {
141: return org_ref_id;
142: }
143:
144: /**
145: * @param org_ref_id The org_ref_id to set.
146: */
147: public void setOrg_ref_id(String org_ref_id) {
148: this .org_ref_id = org_ref_id;
149: }
150:
151: /**
152: * @return Returns the project_cd.
153: */
154: public String getProject_cd() {
155: return project_cd;
156: }
157:
158: /**
159: * @param project_cd The project_cd to set.
160: */
161: public void setProject_cd(String project_cd) {
162: this .project_cd = project_cd;
163: }
164:
165: /**
166: * @return Returns the sub_account_nbr.
167: */
168: public String getSub_account_nbr() {
169: return sub_account_nbr;
170: }
171:
172: /**
173: * @param sub_account_nbr The sub_account_nbr to set.
174: */
175: public void setSub_account_nbr(String sub_account_nbr) {
176: this .sub_account_nbr = sub_account_nbr;
177: }
178:
179: /**
180: * @return Returns the sub_object_cd.
181: */
182: public String getSub_object_cd() {
183: return sub_object_cd;
184: }
185:
186: /**
187: * @param sub_object_cd The sub_object_cd to set.
188: */
189: public void setSub_object_cd(String sub_object_cd) {
190: this.sub_object_cd = sub_object_cd;
191: }
192: }
|