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  import org.apache.commons.lang.StringUtils;
20  import org.kuali.ole.module.purap.util.PurApObjectUtils;
21  import org.kuali.ole.sys.businessobject.AccountingLineBase;
22  import org.kuali.rice.core.api.util.type.KualiDecimal;
23  
24  /**
25   * Payment Request Account Business Object.
26   */
27  public class InvoiceAccount extends PurApAccountingLineBase {
28  
29      private KualiDecimal disencumberedAmount = KualiDecimal.ZERO;
30      private KualiDecimal existingAmount;
31  
32      /**
33       * Default constructor.
34       */
35      public InvoiceAccount() {
36          this.setAmount(null);
37          this.setAccountLinePercent(null);
38          this.setSequenceNumber(0);
39      }
40  
41      /**
42       * Constructor.
43       *
44       * @param item - payment request item
45       * @param poa  - purchase order account
46       */
47      public InvoiceAccount(InvoiceItem item, PurchaseOrderAccount poa) {
48          this();
49          // copy base attributes
50          PurApObjectUtils.populateFromBaseClass(AccountingLineBase.class, poa, this);
51          // copy percent
52          this.setSequenceNumber(poa.getSequenceNumber());
53          this.setAccountLinePercent(poa.getAccountLinePercent());
54          setItemIdentifier(item.getItemIdentifier());
55          setInvoiceItem(item);
56      }
57  
58      public KualiDecimal getDisencumberedAmount() {
59          return disencumberedAmount;
60      }
61  
62      public void setDisencumberedAmount(KualiDecimal disencumberedAmount) {
63          this.disencumberedAmount = disencumberedAmount;
64      }
65  
66      public InvoiceItem getInvoiceItem() {
67          return super.getPurapItem();
68      }
69  
70      public void setInvoiceItem(InvoiceItem invoiceItem) {
71          super.setPurapItem(invoiceItem);
72      }
73  
74      /**
75       * Caller of this method should take care of creating InvoiceItems
76       */
77      public void copyFrom(InvoiceAccount other) {
78          super.copyFrom(other);
79          setDisencumberedAmount(other.getDisencumberedAmount());
80      }
81  
82      @Override
83      public void setFinancialSubObjectCode(String financialSubObjectCode) {
84          super.setFinancialSubObjectCode(StringUtils.trimToNull(financialSubObjectCode));
85      }
86  
87      @Override
88      public void setFinancialObjectCode(String financialObjectCode) {
89          super.setFinancialObjectCode(StringUtils.trimToNull(financialObjectCode));
90      }
91  
92      @Override
93      public void setChartOfAccountsCode(String chartOfAccountsCode) {
94          super.setChartOfAccountsCode(StringUtils.trimToNull(chartOfAccountsCode));
95      }
96  
97      @Override
98      public void setBalanceTypeCode(String balanceTypeCode) {
99          super.setBalanceTypeCode(StringUtils.trimToNull(balanceTypeCode));
100     }
101 
102     @Override
103     public void setAccountNumber(String accountNumber) {
104         super.setAccountNumber(StringUtils.trimToNull(accountNumber));
105     }
106 
107     @Override
108     public void setReferenceTypeCode(String referenceTypeCode) {
109         super.setReferenceTypeCode(StringUtils.trimToNull(referenceTypeCode));
110     }
111 
112     @Override
113     public void setProjectCode(String projectCode) {
114         super.setProjectCode(StringUtils.trimToNull(projectCode));
115     }
116 
117     @Override
118     public void setOverrideCode(String overrideCode) {
119         super.setOverrideCode(StringUtils.trimToNull(overrideCode));
120     }
121 
122     @Override
123     public void setReferenceOriginCode(String originCode) {
124         super.setReferenceOriginCode(StringUtils.trimToNull(originCode));
125     }
126 
127     @Override
128     public void setSubAccountNumber(String subAccountNumber) {
129         super.setSubAccountNumber(StringUtils.trimToNull(subAccountNumber));
130     }
131 
132     @Override
133     public String getSubAccountNumber() {
134         return StringUtils.trimToNull(super.getSubAccountNumber());
135     }
136 
137     @Override
138     public String getFinancialDocumentLineTypeCode() {
139         return StringUtils.trimToNull(super.getFinancialDocumentLineTypeCode());
140     }
141 
142     @Override
143     public String getObjectTypeCode() {
144         return StringUtils.trimToNull(super.getObjectTypeCode());
145     }
146 
147     @Override
148     public void setFinancialDocumentLineTypeCode(String financialDocumentLineTypeCode) {
149         super.setFinancialDocumentLineTypeCode(StringUtils.trimToNull(financialDocumentLineTypeCode));
150     }
151 
152     @Override
153     public String getFinancialSubObjectCode() {
154         return StringUtils.trimToNull(super.getFinancialSubObjectCode());
155     }
156 
157     @Override
158     public String getFinancialObjectCode() {
159         return StringUtils.trimToNull(super.getFinancialObjectCode());
160     }
161 
162     @Override
163     public String getChartOfAccountsCode() {
164         return StringUtils.trimToNull(super.getChartOfAccountsCode());
165     }
166 
167     @Override
168     public String getBalanceTypeCode() {
169         return StringUtils.trimToNull(super.getBalanceTypeCode());
170     }
171 
172     @Override
173     public String getDebitCreditCode() {
174         return StringUtils.trimToNull(super.getDebitCreditCode());
175     }
176 
177     @Override
178     public String getEncumbranceUpdateCode() {
179         return StringUtils.trimToNull(super.getEncumbranceUpdateCode());
180     }
181 
182     @Override
183     public String getProjectCode() {
184         return StringUtils.trimToNull(super.getProjectCode());
185     }
186 
187     @Override
188     public String getReferenceTypeCode() {
189         return StringUtils.trimToNull(super.getReferenceTypeCode());
190     }
191 
192     @Override
193     public String getOverrideCode() {
194         return StringUtils.trimToNull(super.getOverrideCode());
195     }
196 
197     public KualiDecimal getExistingAmount() {
198         return existingAmount;
199     }
200 
201     public void setExistingAmount(KualiDecimal existingAmount) {
202         this.existingAmount = existingAmount;
203     }
204 
205 }