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