001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.kuali.module.gl.bo;
018:
019: import java.sql.Date;
020: import java.util.LinkedHashMap;
021:
022: import org.kuali.core.bo.DocumentType;
023: import org.kuali.core.bo.PersistableBusinessObjectBase;
024: import org.kuali.core.util.KualiDecimal;
025: import org.kuali.kfs.KFSPropertyConstants;
026: import org.kuali.kfs.bo.Options;
027: import org.kuali.module.chart.bo.Account;
028: import org.kuali.module.chart.bo.AccountingPeriod;
029: import org.kuali.module.chart.bo.Chart;
030: import org.kuali.module.chart.bo.ObjectCode;
031: import org.kuali.module.chart.bo.ObjectType;
032: import org.kuali.module.chart.bo.ProjectCode;
033: import org.kuali.module.chart.bo.SubAccount;
034: import org.kuali.module.chart.bo.SubObjCd;
035: import org.kuali.module.chart.bo.codes.BalanceTyp;
036:
037: /**
038: * This class represents a reversal of a transaction
039: */
040: public class Reversal extends PersistableBusinessObjectBase implements
041: Transaction {
042:
043: private Date financialDocumentReversalDate;
044: private Integer universityFiscalYear;
045: private String chartOfAccountsCode;
046: private String accountNumber;
047: private String subAccountNumber;
048: private String financialObjectCode;
049: private String financialSubObjectCode;
050: private String financialBalanceTypeCode;
051: private String financialObjectTypeCode;
052: private String universityFiscalPeriodCode;
053: private String financialDocumentTypeCode;
054: private String financialSystemOriginationCode;
055: private String documentNumber;
056: private Integer transactionLedgerEntrySequenceNumber;
057: private String transactionLedgerEntryDescription;
058: private KualiDecimal transactionLedgerEntryAmount;
059: private String transactionDebitCreditCode;
060: private Date transactionDate;
061: private String organizationDocumentNumber;
062: private String projectCode;
063: private String organizationReferenceId;
064: private String referenceFinancialDocumentTypeCode;
065: private String referenceFinancialSystemOriginationCode;
066: private String referenceFinancialDocumentNumber;
067: private String transactionEncumbranceUpdateCode;
068: private Date transactionPostingDate;
069:
070: // bo references
071: private Account account;
072: private SubAccount subAccount;
073: private BalanceTyp balanceType;
074: private Chart chart;
075: private ObjectCode financialObject;
076: private SubObjCd financialSubObject;
077: private ObjectType objectType;
078: private ProjectCode project;
079: private DocumentType documentType;
080: private UniversityDate universityDate;
081: private Options option;
082: private AccountingPeriod accountingPeriod;
083: private UniversityDate reversalDate;
084:
085: /**
086: * Default constructor.
087: */
088: public Reversal() {
089:
090: }
091:
092: public Reversal(Transaction t) {
093: setUniversityFiscalYear(t.getUniversityFiscalYear());
094: setChartOfAccountsCode(t.getChartOfAccountsCode());
095: setAccountNumber(t.getAccountNumber());
096: setSubAccountNumber(t.getSubAccountNumber());
097: setFinancialObjectCode(t.getFinancialObjectCode());
098: setFinancialSubObjectCode(t.getFinancialSubObjectCode());
099: setFinancialBalanceTypeCode(t.getFinancialBalanceTypeCode());
100: setFinancialObjectTypeCode(t.getFinancialObjectTypeCode());
101: setUniversityFiscalPeriodCode(t.getUniversityFiscalPeriodCode());
102: setFinancialDocumentTypeCode(t.getFinancialDocumentTypeCode());
103: setFinancialSystemOriginationCode(t
104: .getFinancialSystemOriginationCode());
105: setDocumentNumber(t.getDocumentNumber());
106: setTransactionLedgerEntrySequenceNumber(t
107: .getTransactionLedgerEntrySequenceNumber());
108: setTransactionLedgerEntryDescription(t
109: .getTransactionLedgerEntryDescription());
110: setTransactionLedgerEntryAmount(t
111: .getTransactionLedgerEntryAmount());
112: setTransactionDebitCreditCode(t.getTransactionDebitCreditCode());
113: setTransactionDate(t.getTransactionDate());
114: setOrganizationDocumentNumber(t.getOrganizationDocumentNumber());
115: setProjectCode(t.getProjectCode());
116: setOrganizationReferenceId(t.getOrganizationReferenceId());
117: setReferenceFinancialDocumentTypeCode(t
118: .getReferenceFinancialDocumentTypeCode());
119: setReferenceFinancialSystemOriginationCode(t
120: .getReferenceFinancialSystemOriginationCode());
121: setReferenceFinancialDocumentNumber(t
122: .getReferenceFinancialDocumentNumber());
123: setFinancialDocumentReversalDate(t
124: .getFinancialDocumentReversalDate());
125: setTransactionEncumbranceUpdateCode(t
126: .getTransactionEncumbranceUpdateCode());
127: if (transactionPostingDate != null) {
128: setTransactionPostingDate(new Date(transactionPostingDate
129: .getTime()));
130: }
131: }
132:
133: /**
134: * Gets the financialDocumentReversalDate attribute.
135: *
136: * @return Returns the financialDocumentReversalDate
137: */
138: public Date getFinancialDocumentReversalDate() {
139: return financialDocumentReversalDate;
140: }
141:
142: /**
143: * Sets the financialDocumentReversalDate attribute.
144: *
145: * @param financialDocumentReversalDate The financialDocumentReversalDate to set.
146: */
147: public void setFinancialDocumentReversalDate(
148: Date financialDocumentReversalDate) {
149: this .financialDocumentReversalDate = financialDocumentReversalDate;
150: }
151:
152: /**
153: * Gets the universityFiscalYear attribute.
154: *
155: * @return Returns the universityFiscalYear
156: */
157: public Integer getUniversityFiscalYear() {
158: return universityFiscalYear;
159: }
160:
161: /**
162: * Sets the universityFiscalYear attribute.
163: *
164: * @param universityFiscalYear The universityFiscalYear to set.
165: */
166: public void setUniversityFiscalYear(Integer universityFiscalYear) {
167: this .universityFiscalYear = universityFiscalYear;
168: }
169:
170: /**
171: * Gets the chartOfAccountsCode attribute.
172: *
173: * @return Returns the chartOfAccountsCode
174: */
175: public String getChartOfAccountsCode() {
176: return chartOfAccountsCode;
177: }
178:
179: /**
180: * Sets the chartOfAccountsCode attribute.
181: *
182: * @param chartOfAccountsCode The chartOfAccountsCode to set.
183: */
184: public void setChartOfAccountsCode(String chartOfAccountsCode) {
185: this .chartOfAccountsCode = chartOfAccountsCode;
186: }
187:
188: /**
189: * Gets the accountNumber attribute.
190: *
191: * @return Returns the accountNumber
192: */
193: public String getAccountNumber() {
194: return accountNumber;
195: }
196:
197: /**
198: * Sets the accountNumber attribute.
199: *
200: * @param accountNumber The accountNumber to set.
201: */
202: public void setAccountNumber(String accountNumber) {
203: this .accountNumber = accountNumber;
204: }
205:
206: /**
207: * Gets the subAccountNumber attribute.
208: *
209: * @return Returns the subAccountNumber
210: */
211: public String getSubAccountNumber() {
212: return subAccountNumber;
213: }
214:
215: /**
216: * Sets the subAccountNumber attribute.
217: *
218: * @param subAccountNumber The subAccountNumber to set.
219: */
220: public void setSubAccountNumber(String subAccountNumber) {
221: this .subAccountNumber = subAccountNumber;
222: }
223:
224: /**
225: * Gets the financialObjectCode attribute.
226: *
227: * @return Returns the financialObjectCode
228: */
229: public String getFinancialObjectCode() {
230: return financialObjectCode;
231: }
232:
233: /**
234: * Sets the financialObjectCode attribute.
235: *
236: * @param financialObjectCode The financialObjectCode to set.
237: */
238: public void setFinancialObjectCode(String financialObjectCode) {
239: this .financialObjectCode = financialObjectCode;
240: }
241:
242: /**
243: * Gets the financialSubObjectCode attribute.
244: *
245: * @return Returns the financialSubObjectCode
246: */
247: public String getFinancialSubObjectCode() {
248: return financialSubObjectCode;
249: }
250:
251: /**
252: * Sets the financialSubObjectCode attribute.
253: *
254: * @param financialSubObjectCode The financialSubObjectCode to set.
255: */
256: public void setFinancialSubObjectCode(String financialSubObjectCode) {
257: this .financialSubObjectCode = financialSubObjectCode;
258: }
259:
260: /**
261: * Gets the financialBalanceTypeCode attribute.
262: *
263: * @return Returns the financialBalanceTypeCode
264: */
265: public String getFinancialBalanceTypeCode() {
266: return financialBalanceTypeCode;
267: }
268:
269: /**
270: * Sets the financialBalanceTypeCode attribute.
271: *
272: * @param financialBalanceTypeCode The financialBalanceTypeCode to set.
273: */
274: public void setFinancialBalanceTypeCode(
275: String financialBalanceTypeCode) {
276: this .financialBalanceTypeCode = financialBalanceTypeCode;
277: }
278:
279: /**
280: * Gets the financialObjectTypeCode attribute.
281: *
282: * @return Returns the financialObjectTypeCode
283: */
284: public String getFinancialObjectTypeCode() {
285: return financialObjectTypeCode;
286: }
287:
288: /**
289: * Sets the financialObjectTypeCode attribute.
290: *
291: * @param financialObjectTypeCode The financialObjectTypeCode to set.
292: */
293: public void setFinancialObjectTypeCode(
294: String financialObjectTypeCode) {
295: this .financialObjectTypeCode = financialObjectTypeCode;
296: }
297:
298: /**
299: * Gets the universityFiscalPeriodCode attribute.
300: *
301: * @return Returns the universityFiscalPeriodCode
302: */
303: public String getUniversityFiscalPeriodCode() {
304: return universityFiscalPeriodCode;
305: }
306:
307: /**
308: * Sets the universityFiscalPeriodCode attribute.
309: *
310: * @param universityFiscalPeriodCode The universityFiscalPeriodCode to set.
311: */
312: public void setUniversityFiscalPeriodCode(
313: String universityFiscalPeriodCode) {
314: this .universityFiscalPeriodCode = universityFiscalPeriodCode;
315: }
316:
317: /**
318: * Gets the financialDocumentTypeCode attribute.
319: *
320: * @return Returns the financialDocumentTypeCode
321: */
322: public String getFinancialDocumentTypeCode() {
323: return financialDocumentTypeCode;
324: }
325:
326: /**
327: * Sets the financialDocumentTypeCode attribute.
328: *
329: * @param financialDocumentTypeCode The financialDocumentTypeCode to set.
330: */
331: public void setFinancialDocumentTypeCode(
332: String financialDocumentTypeCode) {
333: this .financialDocumentTypeCode = financialDocumentTypeCode;
334: }
335:
336: /**
337: * Gets the financialSystemOriginationCode attribute.
338: *
339: * @return Returns the financialSystemOriginationCode
340: */
341: public String getFinancialSystemOriginationCode() {
342: return financialSystemOriginationCode;
343: }
344:
345: /**
346: * Sets the financialSystemOriginationCode attribute.
347: *
348: * @param financialSystemOriginationCode The financialSystemOriginationCode to set.
349: */
350: public void setFinancialSystemOriginationCode(
351: String financialSystemOriginationCode) {
352: this .financialSystemOriginationCode = financialSystemOriginationCode;
353: }
354:
355: /**
356: * Gets the documentNumber attribute.
357: *
358: * @return Returns the documentNumber
359: */
360: public String getDocumentNumber() {
361: return documentNumber;
362: }
363:
364: /**
365: * Sets the documentNumber attribute.
366: *
367: * @param documentNumber The documentNumber to set.
368: */
369: public void setDocumentNumber(String documentNumber) {
370: this .documentNumber = documentNumber;
371: }
372:
373: /**
374: * Gets the transactionLedgerEntrySequenceNumber attribute.
375: *
376: * @return Returns the transactionLedgerEntrySequenceNumber
377: */
378: public Integer getTransactionLedgerEntrySequenceNumber() {
379: return transactionLedgerEntrySequenceNumber;
380: }
381:
382: /**
383: * Sets the transactionLedgerEntrySequenceNumber attribute.
384: *
385: * @param transactionLedgerEntrySequenceNumber The transactionLedgerEntrySequenceNumber to set.
386: */
387: public void setTransactionLedgerEntrySequenceNumber(
388: Integer transactionLedgerEntrySequenceNumber) {
389: this .transactionLedgerEntrySequenceNumber = transactionLedgerEntrySequenceNumber;
390: }
391:
392: /**
393: * Gets the transactionLedgerEntryDescription attribute.
394: *
395: * @return Returns the transactionLedgerEntryDescription
396: */
397: public String getTransactionLedgerEntryDescription() {
398: return transactionLedgerEntryDescription;
399: }
400:
401: /**
402: * Sets the transactionLedgerEntryDescription attribute.
403: *
404: * @param transactionLedgerEntryDescription The transactionLedgerEntryDescription to set.
405: */
406: public void setTransactionLedgerEntryDescription(
407: String transactionLedgerEntryDescription) {
408: this .transactionLedgerEntryDescription = transactionLedgerEntryDescription;
409: }
410:
411: /**
412: * Gets the transactionLedgerEntryAmount attribute.
413: *
414: * @return Returns the transactionLedgerEntryAmount
415: */
416: public KualiDecimal getTransactionLedgerEntryAmount() {
417: return transactionLedgerEntryAmount;
418: }
419:
420: /**
421: * Sets the transactionLedgerEntryAmount attribute.
422: *
423: * @param transactionLedgerEntryAmount The transactionLedgerEntryAmount to set.
424: */
425: public void setTransactionLedgerEntryAmount(
426: KualiDecimal transactionLedgerEntryAmount) {
427: this .transactionLedgerEntryAmount = transactionLedgerEntryAmount;
428: }
429:
430: /**
431: * Gets the transactionDebitCreditCode attribute.
432: *
433: * @return Returns the transactionDebitCreditCode
434: */
435: public String getTransactionDebitCreditCode() {
436: return transactionDebitCreditCode;
437: }
438:
439: /**
440: * Sets the transactionDebitCreditCode attribute.
441: *
442: * @param transactionDebitCreditCode The transactionDebitCreditCode to set.
443: */
444: public void setTransactionDebitCreditCode(
445: String transactionDebitCreditCode) {
446: this .transactionDebitCreditCode = transactionDebitCreditCode;
447: }
448:
449: /**
450: * Gets the transactionDate attribute.
451: *
452: * @return Returns the transactionDate
453: */
454: public Date getTransactionDate() {
455: return transactionDate;
456: }
457:
458: /**
459: * Sets the transactionDate attribute.
460: *
461: * @param transactionDate The transactionDate to set.
462: */
463: public void setTransactionDate(Date transactionDate) {
464: this .transactionDate = transactionDate;
465: }
466:
467: /**
468: * Gets the organizationDocumentNumber attribute.
469: *
470: * @return Returns the organizationDocumentNumber
471: */
472: public String getOrganizationDocumentNumber() {
473: return organizationDocumentNumber;
474: }
475:
476: /**
477: * Sets the organizationDocumentNumber attribute.
478: *
479: * @param organizationDocumentNumber The organizationDocumentNumber to set.
480: */
481: public void setOrganizationDocumentNumber(
482: String organizationDocumentNumber) {
483: this .organizationDocumentNumber = organizationDocumentNumber;
484: }
485:
486: /**
487: * Gets the projectCode attribute.
488: *
489: * @return Returns the projectCode
490: */
491: public String getProjectCode() {
492: return projectCode;
493: }
494:
495: /**
496: * Sets the projectCode attribute.
497: *
498: * @param projectCode The projectCode to set.
499: */
500: public void setProjectCode(String projectCode) {
501: this .projectCode = projectCode;
502: }
503:
504: /**
505: * Gets the organizationReferenceId attribute.
506: *
507: * @return Returns the organizationReferenceId
508: */
509: public String getOrganizationReferenceId() {
510: return organizationReferenceId;
511: }
512:
513: /**
514: * Sets the organizationReferenceId attribute.
515: *
516: * @param organizationReferenceId The organizationReferenceId to set.
517: */
518: public void setOrganizationReferenceId(
519: String organizationReferenceId) {
520: this .organizationReferenceId = organizationReferenceId;
521: }
522:
523: /**
524: * Gets the referenceFinancialDocumentTypeCode attribute.
525: *
526: * @return Returns the referenceFinancialDocumentTypeCode
527: */
528: public String getReferenceFinancialDocumentTypeCode() {
529: return referenceFinancialDocumentTypeCode;
530: }
531:
532: /**
533: * Sets the referenceFinancialDocumentTypeCode attribute.
534: *
535: * @param referenceFinancialDocumentTypeCode The referenceFinancialDocumentTypeCode to set.
536: */
537: public void setReferenceFinancialDocumentTypeCode(
538: String referenceFinancialDocumentTypeCode) {
539: this .referenceFinancialDocumentTypeCode = referenceFinancialDocumentTypeCode;
540: }
541:
542: /**
543: * Gets the referenceFinancialSystemOriginationCode attribute.
544: *
545: * @return Returns the referenceFinancialSystemOriginationCode
546: */
547: public String getReferenceFinancialSystemOriginationCode() {
548: return referenceFinancialSystemOriginationCode;
549: }
550:
551: /**
552: * Sets the referenceFinancialSystemOriginationCode attribute.
553: *
554: * @param referenceFinancialSystemOriginationCode The referenceFinancialSystemOriginationCode to set.
555: */
556: public void setReferenceFinancialSystemOriginationCode(
557: String referenceFinancialSystemOriginationCode) {
558: this .referenceFinancialSystemOriginationCode = referenceFinancialSystemOriginationCode;
559: }
560:
561: /**
562: * Gets the referenceFinancialDocumentNumber attribute.
563: *
564: * @return Returns the referenceFinancialDocumentNumber
565: */
566: public String getReferenceFinancialDocumentNumber() {
567: return referenceFinancialDocumentNumber;
568: }
569:
570: /**
571: * Sets the referenceFinancialDocumentNumber attribute.
572: *
573: * @param referenceFinancialDocumentNumber The referenceFinancialDocumentNumber to set.
574: */
575: public void setReferenceFinancialDocumentNumber(
576: String referenceFinancialDocumentNumber) {
577: this .referenceFinancialDocumentNumber = referenceFinancialDocumentNumber;
578: }
579:
580: /**
581: * Gets the transactionEncumbranceUpdateCode attribute.
582: *
583: * @return Returns the transactionEncumbranceUpdateCode
584: */
585: public String getTransactionEncumbranceUpdateCode() {
586: return transactionEncumbranceUpdateCode;
587: }
588:
589: /**
590: * Sets the transactionEncumbranceUpdateCode attribute.
591: *
592: * @param transactionEncumbranceUpdateCode The transactionEncumbranceUpdateCode to set.
593: */
594: public void setTransactionEncumbranceUpdateCode(
595: String transactionEncumbranceUpdateCode) {
596: this .transactionEncumbranceUpdateCode = transactionEncumbranceUpdateCode;
597: }
598:
599: /**
600: * Gets the transactionPostingDate attribute.
601: *
602: * @return Returns the transactionPostingDate
603: */
604: public Date getTransactionPostingDate() {
605: return transactionPostingDate;
606: }
607:
608: /**
609: * Sets the transactionPostingDate attribute.
610: *
611: * @param transactionPostingDate The transactionPostingDate to set.
612: */
613: public void setTransactionPostingDate(Date transactionPostingDate) {
614: this .transactionPostingDate = transactionPostingDate;
615: }
616:
617: public Account getAccount() {
618: return account;
619: }
620:
621: public void setAccount(Account account) {
622: this .account = account;
623: }
624:
625: public AccountingPeriod getAccountingPeriod() {
626: return accountingPeriod;
627: }
628:
629: public void setAccountingPeriod(AccountingPeriod accountingPeriod) {
630: this .accountingPeriod = accountingPeriod;
631: }
632:
633: public BalanceTyp getBalanceType() {
634: return balanceType;
635: }
636:
637: public void setBalanceType(BalanceTyp balanceType) {
638: this .balanceType = balanceType;
639: }
640:
641: public Chart getChart() {
642: return chart;
643: }
644:
645: public void setChart(Chart chart) {
646: this .chart = chart;
647: }
648:
649: public DocumentType getDocumentType() {
650: return documentType;
651: }
652:
653: public void setDocumentType(DocumentType documentType) {
654: this .documentType = documentType;
655: }
656:
657: public ObjectCode getFinancialObject() {
658: return financialObject;
659: }
660:
661: public void setFinancialObject(ObjectCode financialObject) {
662: this .financialObject = financialObject;
663: }
664:
665: public SubObjCd getFinancialSubObject() {
666: return financialSubObject;
667: }
668:
669: public void setFinancialSubObject(SubObjCd financialSubObject) {
670: this .financialSubObject = financialSubObject;
671: }
672:
673: public ObjectType getObjectType() {
674: return objectType;
675: }
676:
677: public void setObjectType(ObjectType objectType) {
678: this .objectType = objectType;
679: }
680:
681: public Options getOption() {
682: return option;
683: }
684:
685: public void setOption(Options option) {
686: this .option = option;
687: }
688:
689: public ProjectCode getProject() {
690: return project;
691: }
692:
693: public void setProject(ProjectCode project) {
694: this .project = project;
695: }
696:
697: public UniversityDate getReversalDate() {
698: return reversalDate;
699: }
700:
701: public void setReversalDate(UniversityDate reversalDate) {
702: this .reversalDate = reversalDate;
703: }
704:
705: public SubAccount getSubAccount() {
706: return subAccount;
707: }
708:
709: public void setSubAccount(SubAccount subAccount) {
710: this .subAccount = subAccount;
711: }
712:
713: public UniversityDate getUniversityDate() {
714: return universityDate;
715: }
716:
717: public void setUniversityDate(UniversityDate universityDate) {
718: this .universityDate = universityDate;
719: }
720:
721: protected LinkedHashMap toStringMapper() {
722: LinkedHashMap map = new LinkedHashMap();
723: map.put("universityFiscalYear", getUniversityFiscalYear());
724: map.put("chartOfAccountsCode", getChartOfAccountsCode());
725: map.put("accountNumber", getAccountNumber());
726: map.put("subAccountNumber", getSubAccountNumber());
727: map.put("financialObjectCode", getFinancialObjectCode());
728: map.put("financialSubObjectCode", getFinancialSubObjectCode());
729: map.put("financialBalanceTypeCode",
730: getFinancialBalanceTypeCode());
731: map
732: .put("financialObjectTypeCode",
733: getFinancialObjectTypeCode());
734: map.put("universityFiscalPeriodCode",
735: getUniversityFiscalPeriodCode());
736: map.put("financialDocumentTypeCode",
737: getFinancialDocumentTypeCode());
738: map.put("financialSystemOriginationCode",
739: getFinancialSystemOriginationCode());
740: map.put(KFSPropertyConstants.DOCUMENT_NUMBER,
741: getDocumentNumber());
742: map.put("transactionLedgerEntrySequenceNumber",
743: getTransactionLedgerEntrySequenceNumber());
744: return map;
745: }
746: }
|