View Javadoc
1   /*
2    * Copyright 2007-2008 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  package org.kuali.ole.select.businessobject;
17  
18  import org.kuali.ole.module.purap.PurapConstants.PurapDocTypeCodes;
19  import org.kuali.ole.module.purap.businessobject.InvoiceAccount;
20  import org.kuali.ole.sys.businessobject.SourceAccountingLine;
21  import org.kuali.ole.sys.context.SpringContext;
22  import org.kuali.rice.core.api.datetime.DateTimeService;
23  
24  import java.sql.Timestamp;
25  
26  /**
27   * Payment Request Summary Account Business Object.
28   */
29  public class OleInvoiceAccountsPayableSummaryAccount extends InvoiceAccount {
30  
31      private Integer creditMemoIdentifier;
32      private Timestamp updateTimestamp;
33      private Integer invoiceIdentifier;
34  
35      public OleInvoiceAccountsPayableSummaryAccount() {
36      }
37  
38      public OleInvoiceAccountsPayableSummaryAccount(SourceAccountingLine account, Integer purapDocumentIdentifier, String docType) {
39  
40          if (PurapDocTypeCodes.INVOICE_DOCUMENT.equals(docType)) {
41              this.setInvoiceIdentifier(purapDocumentIdentifier);
42          } else if (PurapDocTypeCodes.CREDIT_MEMO_DOCUMENT.equals(docType)) {
43              this.setCreditMemoIdentifier(purapDocumentIdentifier);
44          }
45          this.setChartOfAccountsCode(account.getChartOfAccountsCode());
46          this.setAccountNumber(account.getAccountNumber());
47          this.setSubAccountNumber(account.getSubAccountNumber());
48          this.setFinancialObjectCode(account.getFinancialObjectCode());
49          this.setFinancialSubObjectCode(account.getFinancialSubObjectCode());
50          this.setProjectCode(account.getProjectCode());
51          this.setOrganizationReferenceId(account.getOrganizationReferenceId());
52          this.setAmount(account.getAmount());
53          this.setSequenceNumber(account.getSequenceNumber());
54          this.setUpdateTimestamp(SpringContext.getBean(DateTimeService.class).getCurrentTimestamp());
55      }
56  
57      /**
58       * ItemIdentifier is not a valid field in this table because it is the summary of accounts for the document, not per item
59       *
60       * @deprecated
61       */
62      @Override
63      public Integer getItemIdentifier() {
64          return super.getItemIdentifier();
65      }
66  
67      /**
68       * ItemIdentifier is not a valid field in this table because it is the summary of accounts for the document, not per item
69       *
70       * @deprecated
71       */
72      @Override
73      public void setItemIdentifier(Integer itemIdentifier) {
74          super.setItemIdentifier(itemIdentifier);
75      }
76  
77      public Integer getInvoiceIdentifier() {
78          return invoiceIdentifier;
79      }
80  
81      public void setInvoiceIdentifier(Integer invoiceIdentifier) {
82          this.invoiceIdentifier = invoiceIdentifier;
83      }
84  
85  
86      public Integer getCreditMemoIdentifier() {
87          return creditMemoIdentifier;
88      }
89  
90      public void setCreditMemoIdentifier(Integer creditMemoIdentifier) {
91          this.creditMemoIdentifier = creditMemoIdentifier;
92      }
93  
94      public Timestamp getUpdateTimestamp() {
95          return updateTimestamp;
96      }
97  
98      public void setUpdateTimestamp(Timestamp updateTimestamp) {
99          this.updateTimestamp = updateTimestamp;
100     }
101 
102 }