View Javadoc
1   /*
2    * Copyright 2007 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   * Created on Sep 2, 2004
18   *
19   */
20  package org.kuali.ole.pdp.businessobject;
21  
22  import java.sql.Date;
23  import java.util.LinkedHashMap;
24  
25  import org.apache.commons.lang.builder.EqualsBuilder;
26  import org.apache.commons.lang.builder.HashCodeBuilder;
27  import org.apache.commons.lang.builder.ToStringBuilder;
28  import org.kuali.ole.coa.businessobject.Account;
29  import org.kuali.ole.gl.businessobject.FlexibleAccountUpdateable;
30  import org.kuali.ole.gl.businessobject.OriginEntryFull;
31  import org.kuali.ole.sys.OLEPropertyConstants;
32  import org.kuali.rice.core.api.util.type.KualiDecimal;
33  import org.kuali.rice.core.api.util.type.KualiInteger;
34  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
35  
36  /**
37   * General Ledger Pending Table for PDP
38   */
39  public class GlPendingTransaction extends PersistableBusinessObjectBase implements FlexibleAccountUpdateable {
40      private KualiInteger id; // GL_PENDING_ENTRY_ID NUMBER 8 0
41      private String fsOriginCd; // FS_ORIGIN_CD VARCHAR2 2
42      private String fdocNbr; // FDOC_NBR VARCHAR2 9
43      private KualiInteger sequenceNbr; // TRN_ENTR_SEQ_NBR NUMBER 5 0
44      private String chartOfAccountsCode; // FIN_COA_CD VARCHAR2 2
45      private String accountNumber; // ACCOUNT_NBR VARCHAR2 7
46      private String subAccountNumber; // SUB_ACCOUNT_NBR VARCHAR2 5
47      private String financialObjectCode; // FIN_OBJECT_CD VARCHAR2 4
48      private String financialSubObjectCode; // FIN_SUB_OBJ_CD VARCHAR2 3
49      private String financialBalanceTypeCode; // FIN_BALANCE_TYP_CD VARCHAR2 2
50      private String finObjTypCd; // FIN_OBJ_TYP_CD VARCHAR2 2
51      private Integer universityFiscalYear; // UNIV_FISCAL_YR NUMBER 4 0
52      private String univFiscalPrdCd; // UNIV_FISCAL_PRD_CD VARCHAR2 2
53      private String description; // TRN_LDGR_ENTR_DESC VARCHAR2 40
54      private KualiDecimal amount; // TRN_LDGR_ENTR_AMT NUMBER 19 2
55      private String debitCrdtCd; // TRN_DEBIT_CRDT_CD VARCHAR2 1
56      private Date transactionDt; // TRANSACTION_DT DATE 7
57      private String financialDocumentTypeCode; // FDOC_TYP_CD VARCHAR2 4
58      private String orgDocNbr; // ORG_DOC_NBR VARCHAR2 10
59      private String projectCd; // PROJECT_CD VARCHAR2 10
60      private String orgReferenceId; // ORG_REFERENCE_ID VARCHAR2 8
61      private String fdocRefTypCd; // FDOC_REF_TYP_CD VARCHAR2 4
62      private String fsRefOriginCd; // FS_REF_ORIGIN_CD VARCHAR2 2
63      private String fdocRefNbr; // FDOC_REF_NBR VARCHAR2 9
64      private Date fdocReversalDt; // FDOC_REVERSAL_DT DATE 7
65      private String trnEncumUpdtCd; // TRN_ENCUM_UPDT_CD VARCHAR2 1
66      private String fdocApprovedCd; // FDOC_APPROVED_CD VARCHAR2 1
67      private String acctSfFinObjCd; // ACCT_SF_FINOBJ_CD VARCHAR2 4
68      private String trnEntrOfstCd; // TRN_ENTR_OFST_CD VARCHAR2 1
69      private boolean processInd; // TRN_EXTRT_IND VARCHAR2 7
70  
71      public GlPendingTransaction() {
72          super();
73          
74          processInd = false;
75      }
76  
77      public OriginEntryFull getOriginEntry() {
78          OriginEntryFull oe = new OriginEntryFull();
79  
80          oe.setFinancialSystemOriginationCode(fsOriginCd);
81          oe.setDocumentNumber(fdocNbr);
82          oe.setTransactionLedgerEntrySequenceNumber(sequenceNbr.intValue());
83          oe.setChartOfAccountsCode(chartOfAccountsCode);
84          oe.setAccountNumber(accountNumber);
85          oe.setSubAccountNumber(subAccountNumber);
86          oe.setFinancialObjectCode(financialObjectCode);
87          oe.setFinancialSubObjectCode(financialSubObjectCode);
88          oe.setFinancialBalanceTypeCode(financialBalanceTypeCode);
89          oe.setFinancialObjectTypeCode(finObjTypCd);
90          oe.setUniversityFiscalYear(universityFiscalYear);
91          oe.setUniversityFiscalPeriodCode(univFiscalPrdCd);
92          oe.setTransactionLedgerEntryDescription(description);
93          if (amount != null) {
94              oe.setTransactionLedgerEntryAmount(amount);
95          }
96          oe.setTransactionDebitCreditCode(debitCrdtCd);
97          if (transactionDt != null) {
98              oe.setTransactionDate(new Date(transactionDt.getTime()));
99          }
100         oe.setFinancialDocumentTypeCode(financialDocumentTypeCode);
101         oe.setOrganizationDocumentNumber(orgDocNbr);
102         oe.setProjectCode(projectCd);
103         oe.setOrganizationReferenceId(orgReferenceId);
104         oe.setReferenceFinancialDocumentTypeCode(fdocRefTypCd);
105         oe.setReferenceFinancialSystemOriginationCode(fsRefOriginCd);
106         oe.setReferenceFinancialDocumentNumber(fdocRefNbr);
107         if (fdocReversalDt != null) {
108             oe.setFinancialDocumentReversalDate(new Date(fdocReversalDt.getTime()));
109         }
110         oe.setTransactionEncumbranceUpdateCode(trnEncumUpdtCd);
111 
112         return oe;
113     }
114 
115     public String getAccountNumber() {
116         return accountNumber;
117     }
118 
119     public void setAccountNumber(String accountNbr) {
120         this.accountNumber = accountNbr;
121     }
122 
123     public String getAcctSfFinObjCd() {
124         return acctSfFinObjCd;
125     }
126 
127     public void setAcctSfFinObjCd(String acctSfFinObjCd) {
128         this.acctSfFinObjCd = acctSfFinObjCd;
129     }
130 
131     public KualiDecimal getAmount() {
132         return amount;
133     }
134 
135     public void setAmount(KualiDecimal amount) {
136         this.amount = amount;
137     }
138 
139     public String getDebitCrdtCd() {
140         return debitCrdtCd;
141     }
142 
143     public void setDebitCrdtCd(String debitCrdtCd) {
144         this.debitCrdtCd = debitCrdtCd;
145     }
146 
147     public String getDescription() {
148         return description;
149     }
150 
151     public void setDescription(String description) {
152         this.description = description;
153     }
154 
155     public String getFdocApprovedCd() {
156         return fdocApprovedCd;
157     }
158 
159     public void setFdocApprovedCd(String fdocApprovedCd) {
160         this.fdocApprovedCd = fdocApprovedCd;
161     }
162 
163     public String getFdocNbr() {
164         return fdocNbr;
165     }
166 
167     public void setFdocNbr(String fdocNbr) {
168         this.fdocNbr = fdocNbr;
169     }
170 
171     public String getFdocRefNbr() {
172         return fdocRefNbr;
173     }
174 
175     public void setFdocRefNbr(String fdocRefNbr) {
176         this.fdocRefNbr = fdocRefNbr;
177     }
178 
179     public String getFdocRefTypCd() {
180         return fdocRefTypCd;
181     }
182 
183     public void setFdocRefTypCd(String fdocRefTypCd) {
184         this.fdocRefTypCd = fdocRefTypCd;
185     }
186 
187     public Date getFdocReversalDt() {
188         return fdocReversalDt;
189     }
190 
191     public void setFdocReversalDt(Date fdocReversalDt) {
192         this.fdocReversalDt = fdocReversalDt;
193     }
194 
195     public String getFinancialDocumentTypeCode() {
196         return financialDocumentTypeCode;
197     }
198 
199     public void setFinancialDocumentTypeCode(String fdocTypCd) {
200         this.financialDocumentTypeCode = fdocTypCd;
201     }
202 
203     public String getFinancialBalanceTypeCode() {
204         return financialBalanceTypeCode;
205     }
206 
207     public void setFinancialBalanceTypeCode(String finBalanceTypCd) {
208         this.financialBalanceTypeCode = finBalanceTypCd;
209     }
210 
211     public String getChartOfAccountsCode() {
212         return chartOfAccountsCode;
213     }
214 
215     public void setChartOfAccountsCode(String finCoaCd) {
216         this.chartOfAccountsCode = finCoaCd;
217     }
218 
219     public String getFinancialObjectCode() {
220         return financialObjectCode;
221     }
222 
223     public void setFinancialObjectCode(String finObjectCd) {
224         this.financialObjectCode = finObjectCd;
225     }
226 
227     public String getFinObjTypCd() {
228         return finObjTypCd;
229     }
230 
231     public void setFinObjTypCd(String finObjTypCd) {
232         this.finObjTypCd = finObjTypCd;
233     }
234 
235     public String getFinancialSubObjectCode() {
236         return financialSubObjectCode;
237     }
238 
239     public void setFinancialSubObjectCode(String finSubObjCd) {
240         this.financialSubObjectCode = finSubObjCd;
241     }
242 
243     public String getFsOriginCd() {
244         return fsOriginCd;
245     }
246 
247     public void setFsOriginCd(String fsOriginCd) {
248         this.fsOriginCd = fsOriginCd;
249     }
250 
251     public String getFsRefOriginCd() {
252         return fsRefOriginCd;
253     }
254 
255     public void setFsRefOriginCd(String fsRefOriginCd) {
256         this.fsRefOriginCd = fsRefOriginCd;
257     }
258 
259     public KualiInteger getId() {
260         return id;
261     }
262 
263     public void setId(KualiInteger id) {
264         this.id = id;
265     }
266 
267     public String getOrgDocNbr() {
268         return orgDocNbr;
269     }
270 
271     public void setOrgDocNbr(String orgDocNbr) {
272         this.orgDocNbr = orgDocNbr;
273     }
274 
275     public String getOrgReferenceId() {
276         return orgReferenceId;
277     }
278 
279     public void setOrgReferenceId(String orgReferenceId) {
280         this.orgReferenceId = orgReferenceId;
281     }
282 
283     /**
284      * Gets the processInd attribute.
285      * 
286      * @return Returns the processInd.
287      */
288     public boolean isProcessInd() {
289         return processInd;
290     }
291 
292     /**
293      * Sets the processInd attribute value.
294      * 
295      * @param processInd The processInd to set.
296      */
297     public void setProcessInd(boolean processInd) {
298         this.processInd = processInd;
299     }
300 
301     public String getProjectCd() {
302         return projectCd;
303     }
304 
305     public void setProjectCd(String projectCd) {
306         this.projectCd = projectCd;
307     }
308 
309     public KualiInteger getSequenceNbr() {
310         return sequenceNbr;
311     }
312 
313     public void setSequenceNbr(KualiInteger sequenceNbr) {
314         this.sequenceNbr = sequenceNbr;
315     }
316 
317     public String getSubAccountNumber() {
318         return subAccountNumber;
319     }
320 
321     public void setSubAccountNumber(String subAccountNbr) {
322         this.subAccountNumber = subAccountNbr;
323     }
324 
325     public Date getTransactionDt() {
326         return transactionDt;
327     }
328 
329     public void setTransactionDt(Date transactionDt) {
330         this.transactionDt = transactionDt;
331     }
332 
333     public String getTrnEncumUpdtCd() {
334         return trnEncumUpdtCd;
335     }
336 
337     public void setTrnEncumUpdtCd(String trnEncumUpdtCd) {
338         this.trnEncumUpdtCd = trnEncumUpdtCd;
339     }
340 
341     public String getTrnEntrOfstCd() {
342         return trnEntrOfstCd;
343     }
344 
345     public void setTrnEntrOfstCd(String trnEntrOfstCd) {
346         this.trnEntrOfstCd = trnEntrOfstCd;
347     }
348 
349     public String getUnivFiscalPrdCd() {
350         return univFiscalPrdCd;
351     }
352 
353     public void setUnivFiscalPrdCd(String univFiscalPrdCd) {
354         this.univFiscalPrdCd = univFiscalPrdCd;
355     }
356 
357     public Integer getUniversityFiscalYear() {
358         return universityFiscalYear;
359     }
360 
361     public void setUniversityFiscalYear(Integer univFiscalYr) {
362         this.universityFiscalYear = univFiscalYr;
363     }
364 
365     public boolean equals(Object obj) {
366         if (!(obj instanceof GlPendingTransaction)) {
367             return false;
368         }
369         GlPendingTransaction o = (GlPendingTransaction) obj;
370         return new EqualsBuilder().append(id, o.getId()).isEquals();
371     }
372 
373     public int hashCode() {
374         return new HashCodeBuilder(83, 5).append(id).toHashCode();
375     }
376 
377     public String toString() {
378         return new ToStringBuilder(this).append("id", id).toString();
379     }
380 
381     public void setAccount(Account a) { /* don't do nada; we're just fulfilling the contract of FlexibleAccountUpdateable */
382     }
383 
384     
385     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
386         LinkedHashMap m = new LinkedHashMap();
387         m.put(OLEPropertyConstants.ID, this.id);
388 
389         return m;
390     }
391 }