001/*
002 * Copyright 2008-2009 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.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/ecl2.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 */
016package org.kuali.ole.fp.businessobject;
017
018import java.util.HashMap;
019import java.util.LinkedHashMap;
020import java.util.Map;
021
022import org.kuali.ole.sys.OLEPropertyConstants;
023import org.kuali.rice.core.api.util.type.KualiDecimal;
024import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
025import org.kuali.rice.krad.util.ObjectUtils;
026
027public class CapitalAssetAccountsGroupDetails extends PersistableBusinessObjectBase {
028
029    //primary key fields..
030    private String documentNumber;
031    private Integer capitalAssetLineNumber;
032    private Integer capitalAssetAccountLineNumber;
033    private Integer sequenceNumber;
034
035    // accounting line info
036    private String financialDocumentLineTypeCode;
037    private String chartOfAccountsCode;
038    private String accountNumber;
039    private String financialObjectCode;
040    private String subAccountNumber;
041    private String financialSubObjectCode;
042    private String projectCode;
043    private String organizationReferenceId;
044    private KualiDecimal amount;
045
046    private CapitalAssetInformation capitalAssetInformation;
047
048    /**
049     * Gets the documentNumber attribute.
050     *
051     * @return Returns the documentNumber
052     */
053
054    public String getDocumentNumber() {
055        return documentNumber;
056    }
057
058    /**
059     * Gets the capitalAssetAccountLineNumber attribute.
060     *
061     * @return Returns the capitalAssetAccountLineNumber
062     */
063
064    public Integer getCapitalAssetAccountLineNumber() {
065        return capitalAssetAccountLineNumber;
066    }
067
068    /**
069     * Gets the financialDocumentLineTypeCode attribute.
070     *
071     * @return Returns the financialDocumentLineTypeCode
072     */
073
074    public String getFinancialDocumentLineTypeCode() {
075        return financialDocumentLineTypeCode;
076    }
077
078    /**
079     * Gets the chartOfAccountsCode attribute.
080     *
081     * @return Returns the chartOfAccountsCode
082     */
083
084    public String getChartOfAccountsCode() {
085        return chartOfAccountsCode;
086    }
087
088    /**
089     * Gets the accountNumber attribute.
090     *
091     * @return Returns the accountNumber
092     */
093
094    public String getAccountNumber() {
095        return accountNumber;
096    }
097
098    /**
099     * Gets the financialObjectCode attribute.
100     *
101     * @return Returns the financialObjectCode
102     */
103
104    public String getFinancialObjectCode() {
105        return financialObjectCode;
106    }
107
108    /**
109     * Gets the capitalAssetInformation attribute.
110     *
111     * @return Returns the capitalAssetInformation.
112     */
113    public CapitalAssetInformation getCapitalAssetInformation() {
114        return capitalAssetInformation;
115    }
116
117    /**
118     * Sets the capitalAssetInformation attribute value.
119     *
120     * @param capitalAssetInformation The capitalAssetInformation to set.
121     */
122    public void setCapitalAssetInformation(CapitalAssetInformation capitalAssetInformation) {
123        this.capitalAssetInformation = capitalAssetInformation;
124    }
125
126
127    /**
128     * Sets the documentNumber attribute.
129     *
130     * @param documentNumber The documentNumber to set.
131     */
132    public void setDocumentNumber(String documentNumber) {
133        this.documentNumber = documentNumber;
134    }
135
136    /**
137     * Sets the capitalAssetAccountLineNumber attribute.
138     *
139     * @param capitalAssetAccountLineNumber The capitalAssetAccountLineNumber to set.
140     */
141    public void setCapitalAssetAccountLineNumber(Integer capitalAssetAccountLineNumber) {
142        this.capitalAssetAccountLineNumber = capitalAssetAccountLineNumber;
143    }
144
145    /**
146     * Sets the financialDocumentLineTypeCode attribute.
147     *
148     * @param financialDocumentLineTypeCode The financialDocumentLineTypeCode to set.
149     */
150    public void setFinancialDocumentLineTypeCode(String financialDocumentLineTypeCode) {
151        this.financialDocumentLineTypeCode = financialDocumentLineTypeCode;
152    }
153
154    /**
155     * Sets the chartOfAccountsCode attribute.
156     *
157     * @param chartOfAccountsCode The chartOfAccountsCode to set.
158     */
159    public void setChartOfAccountsCode(String chartOfAccountsCode) {
160        this.chartOfAccountsCode = chartOfAccountsCode;
161    }
162
163    /**
164     * Sets the accountNumber attribute.
165     *
166     * @param accountNumber The accountNumber to set.
167     */
168    public void setAccountNumber(String accountNumber) {
169        this.accountNumber = accountNumber;
170    }
171
172    /**
173     * Sets the financialObjectCode attribute.
174     *
175     * @param financialObjectCode The financialObjectCode to set.
176     */
177    public void setFinancialObjectCode(String financialObjectCode) {
178        this.financialObjectCode = financialObjectCode;
179    }
180
181    /**
182     * Constructs a CapitalAssetInformation.java.
183     */
184    public CapitalAssetAccountsGroupDetails() {
185        super();
186        setAmount(KualiDecimal.ZERO);
187    }
188
189    /**
190     * Gets the sequenceNumber attribute.
191     *
192     * @return Returns the sequenceNumber
193     */
194
195    public Integer getSequenceNumber() {
196        return sequenceNumber;
197    }
198
199    /**
200     * Sets the sequenceNumber attribute.
201     *
202     * @param sequenceNumber The sequenceNumber to set.
203     */
204    public void setSequenceNumber(Integer sequenceNumber) {
205        this.sequenceNumber = sequenceNumber;
206    }
207
208    protected LinkedHashMap toStringMapper() {
209        LinkedHashMap m = new LinkedHashMap();
210        m.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
211        m.put(OLEPropertyConstants.CAPITAL_ASSET_LINE_NUMBER, this.getCapitalAssetLineNumber());
212        m.put(OLEPropertyConstants.CAPITAL_ASSET_ACCOUNT_LINE_NUMBER, this.getCapitalAssetAccountLineNumber());
213        m.put(OLEPropertyConstants.SEQUENCE_NUMBER, this.getSequenceNumber());
214
215        return m;
216    }
217
218    /**
219     * Returns a map with the primitive field names as the key and the primitive values as the map value.
220     *
221     * @return Map a map with the primitive field names as the key and the primitive values as the map value.
222     */
223    public Map<String, Object> getValuesMap() {
224        Map<String, Object> simpleValues = new HashMap<String, Object>();
225
226        simpleValues.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.getDocumentNumber());
227        simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_LINE_NUMBER, this.getCapitalAssetLineNumber());
228        simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_ACCOUNT_LINE_NUMBER, this.getCapitalAssetAccountLineNumber());
229        simpleValues.put(OLEPropertyConstants.FINANCIAL_DOCUMENT_LINE_TYPE_CODE, this.getFinancialDocumentLineTypeCode());
230        simpleValues.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, this.getChartOfAccountsCode());
231        simpleValues.put(OLEPropertyConstants.ACCOUNT_NUMBER, this.getAccountNumber());
232        simpleValues.put(OLEPropertyConstants.FINANCIAL_OBJECT_CODE, this.getFinancialObjectCode());
233        simpleValues.put(OLEPropertyConstants.AMOUNT, this.getAmount());
234        simpleValues.put(OLEPropertyConstants.SEQUENCE_NUMBER, this.getSequenceNumber());
235
236        return simpleValues;
237    }
238
239    /**
240     * Gets the capitalAssetLineNumber attribute.
241     * @return Returns the capitalAssetLineNumber.
242     */
243    public Integer getCapitalAssetLineNumber() {
244        return capitalAssetLineNumber;
245    }
246
247    /**
248     * Sets the capitalAssetLineNumber attribute value.
249     * @param capitalAssetLineNumber The capitalAssetLineNumber to set.
250     */
251    public void setCapitalAssetLineNumber(Integer capitalAssetLineNumber) {
252        this.capitalAssetLineNumber = capitalAssetLineNumber;
253    }
254
255    /**
256     * @return Returns the amount.
257     */
258    public KualiDecimal getAmount() {
259        if (ObjectUtils.isNull(amount)) {
260            return KualiDecimal.ZERO;
261        }
262        else {
263            return amount;
264        }
265    }
266
267    /**
268     * @param amount The amount to set.
269     */
270    public void setAmount(KualiDecimal amount) {
271        if (ObjectUtils.isNull(amount)) {
272            this.amount = KualiDecimal.ZERO;
273        }
274        else {
275            this.amount = amount;
276        }
277
278        this.amount = amount;
279    }
280
281    public String getSubAccountNumber() {
282        return subAccountNumber;
283    }
284
285    public void setSubAccountNumber(String subAccountNumber) {
286        this.subAccountNumber = subAccountNumber;
287    }
288
289    public String getFinancialSubObjectCode() {
290        return financialSubObjectCode;
291    }
292
293    public void setFinancialSubObjectCode(String financialSubObjectCode) {
294        this.financialSubObjectCode = financialSubObjectCode;
295    }
296
297    public String getProjectCode() {
298        return projectCode;
299    }
300
301    public void setProjectCode(String projectCode) {
302        this.projectCode = projectCode;
303    }
304
305    public String getOrganizationReferenceId() {
306        return organizationReferenceId;
307    }
308
309    public void setOrganizationReferenceId(String organizationReferenceId) {
310        this.organizationReferenceId = organizationReferenceId;
311    }
312        
313}