001 /*
002 * Copyright 2011 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 */
016
017 package org.kuali.kfs.module.purap.businessobject;
018
019 import java.sql.Timestamp;
020 import java.util.HashMap;
021 import java.util.HashSet;
022
023 import org.kuali.kfs.coa.businessobject.AccountingPeriod;
024 import org.kuali.kfs.module.purap.util.PurApObjectUtils;
025 import org.kuali.kfs.sys.context.SpringContext;
026 import org.kuali.rice.kns.service.DateTimeService;
027
028
029 /**
030 * Credit Memo Account Revision Business Object.
031 */
032 public class CreditMemoAccountRevision extends CreditMemoAccount {
033
034 protected Integer accountRevisionIdentifier;
035 private Timestamp accountRevisionTimestamp;
036
037 private AccountingPeriod accountingPeriod;
038
039 public AccountingPeriod getAccountingPeriod() {
040 return accountingPeriod;
041 }
042
043 public void setAccountingPeriod(AccountingPeriod accountingPeriod) {
044 this.accountingPeriod = accountingPeriod;
045 }
046
047 /**
048 * Default constructor.
049 */
050 public CreditMemoAccountRevision() {
051 }
052
053 /**
054 * Constructor.
055 *
056 * @param account - credit memo account
057 */
058 public CreditMemoAccountRevision(CreditMemoAccount cma, Integer postingYear, String postingPeriodCode) {
059 // copy base attributes
060 PurApObjectUtils.populateFromBaseWithSuper(cma, this, new HashMap<String, Class<?>>(), new HashSet<Class>());
061 this.setAccountRevisionTimestamp(SpringContext.getBean(DateTimeService.class).getCurrentTimestamp());
062 this.setPostingYear(postingYear);
063 this.setPostingPeriodCode(postingPeriodCode);
064 }
065
066 public Integer getAccountRevisionIdentifier() {
067 return accountRevisionIdentifier;
068 }
069
070 public void setAccountRevisionIdentifier(Integer accountRevisionIdentifier) {
071 this.accountRevisionIdentifier = accountRevisionIdentifier;
072 }
073
074 public Timestamp getAccountRevisionTimestamp() {
075 return accountRevisionTimestamp;
076 }
077
078 public void setAccountRevisionTimestamp(Timestamp accountRevisionTimestamp) {
079 this.accountRevisionTimestamp = accountRevisionTimestamp;
080 }
081
082 }