View Javadoc
1   /*
2    * Copyright 2006 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.kuali.ole.module.purap.businessobject;
18  
19  
20  import org.kuali.ole.module.purap.util.PurApObjectUtils;
21  import org.kuali.ole.sys.businessobject.AccountingLineBase;
22  
23  /**
24   * Accounting line Business Object for a credit memo item line.
25   */
26  public class CreditMemoAccount extends PurApAccountingLineBase {
27  
28      /**
29       * Default constructor.
30       */
31      public CreditMemoAccount() {
32  
33      }
34  
35      /**
36       * Constructs a Credit Memo Account object from an existing PurAp Accounting Line object.
37       *
38       * @param accountingLine the accounting line to copy from.
39       */
40      public CreditMemoAccount(PurApAccountingLineBase accountingLine) {
41          super();
42  
43          setChartOfAccountsCode(accountingLine.getChartOfAccountsCode());
44          setAccountNumber(accountingLine.getAccountNumber());
45          setSubAccountNumber(accountingLine.getSubAccountNumber());
46          setFinancialObjectCode(accountingLine.getFinancialObjectCode());
47          setFinancialSubObjectCode(accountingLine.getFinancialSubObjectCode());
48          setProjectCode(accountingLine.getProjectCode());
49          setOrganizationReferenceId(accountingLine.getOrganizationReferenceId());
50          setAmount(accountingLine.getAmount());
51          setAccountLinePercent(accountingLine.getAccountLinePercent());
52          this.setSequenceNumber(accountingLine.getSequenceNumber());
53      }
54  
55      /**
56       * Constructor.
57       *
58       * @param item           - credit request item
59       * @param invoiceAccount - credit account
60       */
61      public CreditMemoAccount(CreditMemoItem item, InvoiceAccount invoiceAccount) {
62          this();
63          // copy base attributes
64          PurApObjectUtils.populateFromBaseClass(AccountingLineBase.class, invoiceAccount, this);
65          // copy percent
66          this.setSequenceNumber(invoiceAccount.getSequenceNumber());
67          this.setAccountLinePercent(invoiceAccount.getAccountLinePercent());
68          setItemIdentifier(item.getItemIdentifier());
69          setCreditMemoItem(item);
70      }
71  
72      public CreditMemoItem getCreditMemoItem() {
73          return super.getPurapItem();
74      }
75  
76      /**
77       * @deprecated
78       */
79      public void setCreditMemoItem(CreditMemoItem creditMemoItem) {
80          super.setPurapItem(creditMemoItem);
81      }
82  }