Source Code Cross Referenced for AccountingLineBase.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » kfs » bo » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » Kuali Financial System » org.kuali.kfs.bo 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 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:        package org.kuali.kfs.bo;
017:
018:        import java.io.Serializable;
019:        import java.util.HashMap;
020:        import java.util.Iterator;
021:        import java.util.LinkedHashMap;
022:        import java.util.Map;
023:
024:        import org.apache.commons.lang.builder.EqualsBuilder;
025:        import org.apache.commons.lang.builder.HashCodeBuilder;
026:        import org.apache.log4j.Logger;
027:        import org.kuali.core.bo.DocumentType;
028:        import org.kuali.core.bo.PersistableBusinessObjectBase;
029:        import org.kuali.core.util.KualiDecimal;
030:        import org.kuali.core.util.ObjectUtils;
031:        import org.kuali.kfs.KFSPropertyConstants;
032:        import org.kuali.kfs.context.SpringContext;
033:        import org.kuali.module.chart.bo.Account;
034:        import org.kuali.module.chart.bo.Chart;
035:        import org.kuali.module.chart.bo.ObjectCode;
036:        import org.kuali.module.chart.bo.ObjectType;
037:        import org.kuali.module.chart.bo.ProjectCode;
038:        import org.kuali.module.chart.bo.SubAccount;
039:        import org.kuali.module.chart.bo.SubObjCd;
040:        import org.kuali.module.chart.bo.codes.BalanceTyp;
041:        import org.kuali.module.chart.service.BalanceTypService;
042:        import org.kuali.module.financial.bo.SalesTax;
043:        import org.kuali.module.financial.service.UniversityDateService;
044:
045:        /**
046:         * This is the generic class which contains all the elements on a typical line of accounting elements. These are all the accounting
047:         * items necessary to create a pending entry to the G/L. All transaction documents will use this business object inherently.
048:         */
049:        public abstract class AccountingLineBase extends
050:                PersistableBusinessObjectBase implements  Serializable,
051:                AccountingLine {
052:            private static Logger LOG = Logger
053:                    .getLogger(AccountingLineBase.class);
054:
055:            private String documentNumber;
056:            private Integer sequenceNumber; // relative to the grouping of acctng lines
057:            private Integer postingYear;
058:            private KualiDecimal amount;
059:            private String referenceOriginCode;
060:            private String referenceNumber;
061:            private String referenceTypeCode;
062:            private String overrideCode = AccountingLineOverride.CODE.NONE;
063:            private boolean accountExpiredOverride; // for the UI, persisted in overrideCode
064:            private boolean accountExpiredOverrideNeeded; // for the UI, not persisted
065:            private boolean nonFringeAccountOverride; // for the UI, persisted in overrideCode
066:            private boolean nonFringeAccountOverrideNeeded; // for the UI, not persisted
067:            private boolean objectBudgetOverride;
068:            private boolean objectBudgetOverrideNeeded;
069:            private String organizationReferenceId;
070:            private String debitCreditCode; // should only be set by the Journal Voucher or Auxiliary Voucher document
071:            private String encumbranceUpdateCode; // should only be set by the Journal Voucher document
072:            protected String financialDocumentLineTypeCode;
073:            protected String financialDocumentLineDescription;
074:            protected boolean salesTaxRequired;
075:
076:            private String chartOfAccountsCode;
077:            private String accountNumber;
078:            private String financialObjectCode;
079:            private String subAccountNumber;
080:            private String financialSubObjectCode;
081:            private String projectCode;
082:            private String balanceTypeCode;
083:            private String objectTypeCode;
084:
085:            // bo references
086:            private Chart chart;
087:            private Account account;
088:            private ObjectCode objectCode;
089:            private SubAccount subAccount;
090:            private SubObjCd subObjectCode;
091:            private ProjectCode project;
092:            private BalanceTyp balanceTyp;
093:            private ObjectType objectType; // should only be set by the Journal Voucher document
094:            private OriginationCode referenceOrigin;
095:            private DocumentType referenceType;
096:            private SalesTax salesTax;
097:
098:            /**
099:             * This constructor sets up empty instances for the dependent objects.
100:             */
101:            public AccountingLineBase() {
102:                setAmount(new KualiDecimal(0));
103:                chart = new Chart();
104:                account = new Account();
105:                objectCode = new ObjectCode();
106:                subAccount = new SubAccount();
107:                subObjectCode = new SubObjCd();
108:                project = new ProjectCode();
109:                postingYear = SpringContext
110:                        .getBean(UniversityDateService.class)
111:                        .getCurrentFiscalYear();
112:                objectCode.setUniversityFiscalYear(postingYear);
113:                // all Financial Transaction Processing accounting lines (those extending from this) should use a balance type
114:                // of Actual, except for JV which allows a choice and PE which uses "PE"
115:                balanceTyp = SpringContext.getBean(BalanceTypService.class)
116:                        .getActualBalanceTyp();
117:                objectType = new ObjectType();
118:                // salesTax = new SalesTax();
119:                salesTaxRequired = false;
120:            }
121:
122:            /**
123:             * @return Returns the account.
124:             */
125:            public Account getAccount() {
126:                return account;
127:            }
128:
129:            /**
130:             * @param account The account to set.
131:             * @deprecated
132:             */
133:            public void setAccount(Account account) {
134:                this .account = account;
135:            }
136:
137:            /**
138:             * @return Returns the chartOfAccountsCode.
139:             */
140:            public Chart getChart() {
141:                return chart;
142:            }
143:
144:            /**
145:             * @param chart The chartOfAccountsCode to set.
146:             * @deprecated
147:             */
148:            public void setChart(Chart chart) {
149:                this .chart = chart;
150:            }
151:
152:            /**
153:             * @return Returns the documentNumber.
154:             */
155:            public String getDocumentNumber() {
156:                return documentNumber;
157:            }
158:
159:            /**
160:             * @return Returns the amount.
161:             */
162:            public KualiDecimal getAmount() {
163:                return amount;
164:            }
165:
166:            /**
167:             * @param amount The amount to set.
168:             */
169:            public void setAmount(KualiDecimal amount) {
170:                this .amount = amount;
171:            }
172:
173:            /**
174:             * @return Returns the balanceTyp.
175:             */
176:            public BalanceTyp getBalanceTyp() {
177:                return balanceTyp;
178:            }
179:
180:            /**
181:             * @param balanceTyp The balanceTyp to set.
182:             * @deprecated
183:             */
184:            public void setBalanceTyp(BalanceTyp balanceTyp) {
185:                this .balanceTyp = balanceTyp;
186:            }
187:
188:            /**
189:             * @return Returns the objectCode.
190:             */
191:            public ObjectCode getObjectCode() {
192:                return objectCode;
193:            }
194:
195:            /**
196:             * @param objectCode The objectCode to set.
197:             * @deprecated
198:             */
199:            public void setObjectCode(ObjectCode objectCode) {
200:                this .objectCode = objectCode;
201:            }
202:
203:            /**
204:             * @return Returns the referenceOriginCode.
205:             */
206:            public String getReferenceOriginCode() {
207:                return referenceOriginCode;
208:            }
209:
210:            /**
211:             * @param originCode The referenceOriginCode to set.
212:             */
213:            public void setReferenceOriginCode(String originCode) {
214:                this .referenceOriginCode = originCode;
215:            }
216:
217:            /**
218:             * This method returns the object related to referenceOriginCode
219:             * 
220:             * @return referenceOrigin
221:             */
222:            public OriginationCode getReferenceOrigin() {
223:                return referenceOrigin;
224:            }
225:
226:            /**
227:             * This method sets the referenceOrigin object, this is only to be used by OJB
228:             * 
229:             * @param referenceOrigin
230:             * @deprecated
231:             */
232:            public void setReferenceOrigin(OriginationCode referenceOrigin) {
233:                this .referenceOrigin = referenceOrigin;
234:            }
235:
236:            /**
237:             * This method returns the referenceType associated with the referenceTypeCode
238:             * 
239:             * @return referenceType
240:             */
241:            public DocumentType getReferenceType() {
242:                return referenceType;
243:            }
244:
245:            /**
246:             * This method sets the referenceType, this is only to be used by OJB
247:             * 
248:             * @param referenceType
249:             * @deprecated
250:             */
251:            public void setReferenceType(DocumentType referenceType) {
252:                this .referenceType = referenceType;
253:            }
254:
255:            /**
256:             * @return Returns the organizationReferenceId.
257:             */
258:            public String getOrganizationReferenceId() {
259:                return organizationReferenceId;
260:            }
261:
262:            /**
263:             * @param organizationReferenceId The organizationReferenceId to set.
264:             */
265:            public void setOrganizationReferenceId(
266:                    String organizationReferenceId) {
267:                this .organizationReferenceId = organizationReferenceId;
268:            }
269:
270:            /**
271:             * @return Returns the overrideCode.
272:             */
273:            public String getOverrideCode() {
274:                return overrideCode;
275:            }
276:
277:            /**
278:             * @param overrideCode The overrideCode to set.
279:             */
280:            public void setOverrideCode(String overrideCode) {
281:                this .overrideCode = overrideCode;
282:            }
283:
284:            /**
285:             * @return Returns the postingYear.
286:             */
287:            public Integer getPostingYear() {
288:                return postingYear;
289:            }
290:
291:            /**
292:             * @param postingYear The postingYear to set.
293:             */
294:            public void setPostingYear(Integer postingYear) {
295:                this .postingYear = postingYear;
296:            }
297:
298:            /**
299:             * @return Returns the projectCode.
300:             */
301:            public String getProjectCode() {
302:                return projectCode;
303:            }
304:
305:            /**
306:             * @param projectCode The projectCode to set.
307:             */
308:            public void setProjectCode(String projectCode) {
309:                this .projectCode = projectCode;
310:            }
311:
312:            /**
313:             * @return Returns the referenceNumber.
314:             */
315:            public String getReferenceNumber() {
316:                return referenceNumber;
317:            }
318:
319:            /**
320:             * @param referenceNumber The referenceNumber to set.
321:             */
322:            public void setReferenceNumber(String referenceNumber) {
323:                this .referenceNumber = referenceNumber;
324:            }
325:
326:            /**
327:             * @return Returns the referenceTypeCode.
328:             */
329:            public String getReferenceTypeCode() {
330:                return referenceTypeCode;
331:            }
332:
333:            /**
334:             * @param referenceTypeCode The referenceTypeCode to set.
335:             */
336:            public void setReferenceTypeCode(String referenceTypeCode) {
337:                this .referenceTypeCode = referenceTypeCode;
338:            }
339:
340:            /**
341:             * @return Returns the sequenceNumber.
342:             */
343:            public Integer getSequenceNumber() {
344:                return sequenceNumber;
345:            }
346:
347:            /**
348:             * @param sequenceNumber The sequenceNumber to set.
349:             */
350:            public void setSequenceNumber(Integer sequenceNumber) {
351:                this .sequenceNumber = sequenceNumber;
352:            }
353:
354:            /**
355:             * @return Returns the subAccount.
356:             */
357:            public SubAccount getSubAccount() {
358:                return subAccount;
359:            }
360:
361:            /**
362:             * @param subAccount The subAccount to set.
363:             * @deprecated
364:             */
365:            public void setSubAccount(SubAccount subAccount) {
366:                this .subAccount = subAccount;
367:            }
368:
369:            /**
370:             * @return Returns the subObjectCode.
371:             */
372:            public SubObjCd getSubObjectCode() {
373:                return subObjectCode;
374:            }
375:
376:            /**
377:             * @param subObjectCode The subObjectCode to set.
378:             * @deprecated
379:             */
380:            public void setSubObjectCode(SubObjCd subObjectCode) {
381:                this .subObjectCode = subObjectCode;
382:            }
383:
384:            /**
385:             * @see org.kuali.kfs.bo.AccountingLine#getSalesTax()
386:             */
387:            public SalesTax getSalesTax() {
388:                return salesTax;
389:            }
390:
391:            /**
392:             * @see org.kuali.kfs.bo.AccountingLine#setSalesTax(org.kuali.module.financial.bo.SalesTax)
393:             * @deprecated
394:             */
395:            public void setSalesTax(SalesTax salesTax) {
396:                this .salesTax = salesTax;
397:            }
398:
399:            /**
400:             * @see org.kuali.kfs.bo.AccountingLine#isSalesTaxRequired()
401:             */
402:            public boolean isSalesTaxRequired() {
403:                return salesTaxRequired;
404:            }
405:
406:            /**
407:             * @see org.kuali.kfs.bo.AccountingLine#setSalesTaxRequired(boolean)
408:             */
409:            public void setSalesTaxRequired(boolean salesTaxRequired) {
410:                this .salesTaxRequired = salesTaxRequired;
411:            }
412:
413:            /**
414:             * @param documentNumber The documentNumber to set.
415:             */
416:            public void setDocumentNumber(String documentNumber) {
417:                this .documentNumber = documentNumber;
418:            }
419:
420:            /**
421:             * This method retrieves the debit/credit code for the accounting line. This method will only return a not null value for a
422:             * Journal Voucher document.
423:             * 
424:             * @return A String code.
425:             */
426:            public String getDebitCreditCode() {
427:                return debitCreditCode;
428:            }
429:
430:            /**
431:             * This method sets the debit/credit code for the accounting line. This method should only be used for a Journal Voucher
432:             * document.
433:             * 
434:             * @param debitCreditCode
435:             */
436:            public void setDebitCreditCode(String debitCreditCode) {
437:                this .debitCreditCode = debitCreditCode;
438:            }
439:
440:            /**
441:             * This method retrieves the encumbrance update code for the accounting line. This method will only return a not null value for
442:             * a Journal Voucher document.
443:             * 
444:             * @return A String code.
445:             */
446:            public String getEncumbranceUpdateCode() {
447:                return encumbranceUpdateCode;
448:            }
449:
450:            /**
451:             * This method sets the debit/credit code for the accounting line. This method should only be used for a Journal Voucher
452:             * document.
453:             * 
454:             * @param encumbranceUpdateCode
455:             */
456:            public void setEncumbranceUpdateCode(String encumbranceUpdateCode) {
457:                this .encumbranceUpdateCode = encumbranceUpdateCode;
458:            }
459:
460:            /**
461:             * This method retrieves the ObjectType for the accounting line. This method will only return a not null value for a Journal
462:             * Voucher document.
463:             * 
464:             * @return An ObjectType instance.
465:             */
466:            public ObjectType getObjectType() {
467:                return objectType;
468:            }
469:
470:            /**
471:             * This method sets the ObjectType for the accounting line. This method should only be used for a Journal Voucher document.
472:             * 
473:             * @param objectType
474:             * @deprecated
475:             */
476:            public void setObjectType(ObjectType objectType) {
477:                this .objectType = objectType;
478:            }
479:
480:            /**
481:             * @return Returns the accountNumber.
482:             */
483:            public String getAccountNumber() {
484:                return accountNumber;
485:            }
486:
487:            /**
488:             * @param accountNumber The accountNumber to set.
489:             */
490:            public void setAccountNumber(String accountNumber) {
491:                this .accountNumber = accountNumber;
492:            }
493:
494:            /**
495:             * @return Returns the balanceTypeCode.
496:             */
497:            public String getBalanceTypeCode() {
498:                return balanceTypeCode;
499:            }
500:
501:            /**
502:             * @param balanceTypeCode The balanceTypeCode to set.
503:             */
504:            public void setBalanceTypeCode(String balanceTypeCode) {
505:                this .balanceTypeCode = balanceTypeCode;
506:            }
507:
508:            /**
509:             * @return Returns the chartOfAccountsCode.
510:             */
511:            public String getChartOfAccountsCode() {
512:                return chartOfAccountsCode;
513:            }
514:
515:            /**
516:             * @param chartOfAccountsCode The chartOfAccountsCode to set.
517:             */
518:            public void setChartOfAccountsCode(String chartOfAccountsCode) {
519:                this .chartOfAccountsCode = chartOfAccountsCode;
520:            }
521:
522:            /**
523:             * @return Returns the financialObjectCode.
524:             */
525:            public String getFinancialObjectCode() {
526:                return financialObjectCode;
527:            }
528:
529:            /**
530:             * @param financialObjectCode The financialObjectCode to set.
531:             */
532:            public void setFinancialObjectCode(String financialObjectCode) {
533:                this .financialObjectCode = financialObjectCode;
534:            }
535:
536:            /**
537:             * @return Returns the financialSubObjectCode.
538:             */
539:            public String getFinancialSubObjectCode() {
540:                return financialSubObjectCode;
541:            }
542:
543:            /**
544:             * @param financialSubObjectCode The financialSubObjectCode to set.
545:             */
546:            public void setFinancialSubObjectCode(String financialSubObjectCode) {
547:                this .financialSubObjectCode = financialSubObjectCode;
548:            }
549:
550:            /**
551:             * @return Returns the objectTypeCode.
552:             */
553:            public String getObjectTypeCode() {
554:                return objectTypeCode;
555:            }
556:
557:            /**
558:             * @param objectTypeCode The objectTypeCode to set.
559:             */
560:            public void setObjectTypeCode(String objectTypeCode) {
561:                this .objectTypeCode = objectTypeCode;
562:            }
563:
564:            /**
565:             * @return Returns the financialDocumentLineTypeCode.
566:             */
567:            public String getFinancialDocumentLineTypeCode() {
568:                return financialDocumentLineTypeCode;
569:            }
570:
571:            /**
572:             * @param financialDocumentLineTypeCode The financialDocumentLineTypeCode to set.
573:             */
574:            public void setFinancialDocumentLineTypeCode(
575:                    String financialDocumentLineTypeCode) {
576:                this .financialDocumentLineTypeCode = financialDocumentLineTypeCode;
577:            }
578:
579:            /**
580:             * @return Returns the project.
581:             */
582:            public ProjectCode getProject() {
583:                return project;
584:            }
585:
586:            /**
587:             * @param project The project to set.
588:             * @deprecated
589:             */
590:            public void setProject(ProjectCode project) {
591:                this .project = project;
592:            }
593:
594:            /**
595:             * @return Returns the subAccountNumber.
596:             */
597:            public String getSubAccountNumber() {
598:                return subAccountNumber;
599:            }
600:
601:            /**
602:             * @param subAccountNumber The subAccountNumber to set.
603:             */
604:            public void setSubAccountNumber(String subAccountNumber) {
605:                this .subAccountNumber = subAccountNumber;
606:            }
607:
608:            /**
609:             * @return Returns the financialDocumentLineDescription.
610:             */
611:            public String getFinancialDocumentLineDescription() {
612:                return financialDocumentLineDescription;
613:            }
614:
615:            /**
616:             * @param financialDocumentLineDescription The financialDocumentLineDescription to set.
617:             */
618:            public void setFinancialDocumentLineDescription(
619:                    String financialDocumentLineDescription) {
620:                this .financialDocumentLineDescription = financialDocumentLineDescription;
621:            }
622:
623:            /**
624:             * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
625:             */
626:            protected LinkedHashMap toStringMapper() {
627:                LinkedHashMap m = new LinkedHashMap();
628:
629:                m.put(KFSPropertyConstants.DOCUMENT_NUMBER, documentNumber);
630:
631:                m.put("sequenceNumber", sequenceNumber);
632:                m.put("postingYear", postingYear);
633:                m.put("amount", amount);
634:                m.put("debitCreditCode", debitCreditCode);
635:                m.put("encumbranceUpdateCode", encumbranceUpdateCode);
636:                m.put("financialDocumentLineDescription",
637:                        financialDocumentLineDescription);
638:
639:                m.put("chart", getChartOfAccountsCode());
640:                m.put("account", getAccountNumber());
641:                m.put("objectCode", getFinancialObjectCode());
642:                m.put("subAccount", getSubAccountNumber());
643:                m.put("subObjectCode", getFinancialSubObjectCode());
644:                m.put("projectCode", getProjectCode());
645:                m.put("balanceTyp", getBalanceTypeCode());
646:                m.put("objectType", getObjectTypeCode());
647:
648:                m.put("orgRefId", getOrganizationReferenceId());
649:
650:                return m;
651:            }
652:
653:            /**
654:             * @see org.kuali.core.bo.AccountingLine#isSourceAccountingLine()
655:             */
656:            public boolean isSourceAccountingLine() {
657:                return (this  instanceof  SourceAccountingLine);
658:            }
659:
660:            /**
661:             * @see org.kuali.core.bo.AccountingLine#isTargetAccountingLine()
662:             */
663:            public boolean isTargetAccountingLine() {
664:                return (this  instanceof  TargetAccountingLine);
665:            }
666:
667:            /**
668:             * @see org.kuali.core.bo.AccountingLine#getAccountKey()
669:             */
670:            public String getAccountKey() {
671:                String key = getChartOfAccountsCode() + ":"
672:                        + getAccountNumber();
673:                return key;
674:            }
675:
676:            /**
677:             * @see org.kuali.core.bo.AccountingLine#copyFrom(org.kuali.core.bo.AccountingLine)
678:             */
679:            public void copyFrom(AccountingLine other) {
680:                if (other == null) {
681:                    throw new IllegalArgumentException("invalid (null) other");
682:                }
683:
684:                if (this  != other) {
685:                    // primitive fields
686:                    setSequenceNumber(other.getSequenceNumber());
687:                    setDocumentNumber(other.getDocumentNumber());
688:                    setPostingYear(other.getPostingYear());
689:                    setAmount(other.getAmount());
690:                    setReferenceOriginCode(other.getReferenceOriginCode());
691:                    setReferenceNumber(other.getReferenceNumber());
692:                    setReferenceTypeCode(other.getReferenceTypeCode());
693:                    setOverrideCode(other.getOverrideCode());
694:                    setOrganizationReferenceId(other
695:                            .getOrganizationReferenceId());
696:                    setDebitCreditCode(other.getDebitCreditCode());
697:                    setEncumbranceUpdateCode(other.getEncumbranceUpdateCode());
698:                    setFinancialDocumentLineTypeCode(other
699:                            .getFinancialDocumentLineTypeCode());
700:                    setFinancialDocumentLineDescription(other
701:                            .getFinancialDocumentLineDescription());
702:                    setAccountExpiredOverride(other.getAccountExpiredOverride());
703:                    setAccountExpiredOverrideNeeded(other
704:                            .getAccountExpiredOverrideNeeded());
705:                    setObjectBudgetOverride(other.isObjectBudgetOverride());
706:                    setObjectBudgetOverrideNeeded(other
707:                            .isObjectBudgetOverrideNeeded());
708:
709:                    // foreign keys
710:                    setChartOfAccountsCode(other.getChartOfAccountsCode());
711:                    setAccountNumber(other.getAccountNumber());
712:                    setFinancialObjectCode(other.getFinancialObjectCode());
713:                    setSubAccountNumber(other.getSubAccountNumber());
714:                    setFinancialSubObjectCode(other.getFinancialSubObjectCode());
715:                    setProjectCode(other.getProjectCode());
716:                    setBalanceTypeCode(other.getBalanceTypeCode());
717:                    setObjectTypeCode(other.getObjectTypeCode());
718:
719:                    // sales tax
720:                    if (ObjectUtils.isNotNull(other.getSalesTax())) {
721:                        SalesTax salesTax = getSalesTax();
722:                        SalesTax origSalesTax = other.getSalesTax();
723:                        if (salesTax != null) {
724:                            salesTax.setAccountNumber(origSalesTax
725:                                    .getAccountNumber());
726:                            salesTax.setChartOfAccountsCode(origSalesTax
727:                                    .getChartOfAccountsCode());
728:                            salesTax
729:                                    .setFinancialDocumentGrossSalesAmount(origSalesTax
730:                                            .getFinancialDocumentGrossSalesAmount());
731:                            salesTax
732:                                    .setFinancialDocumentTaxableSalesAmount(origSalesTax
733:                                            .getFinancialDocumentTaxableSalesAmount());
734:                            salesTax.setFinancialDocumentSaleDate(origSalesTax
735:                                    .getFinancialDocumentSaleDate());
736:
737:                            // primary keys
738:                            salesTax.setDocumentNumber(other
739:                                    .getDocumentNumber());
740:                            salesTax.setFinancialDocumentLineNumber(other
741:                                    .getSequenceNumber());
742:                            salesTax.setFinancialDocumentLineTypeCode(other
743:                                    .getFinancialDocumentLineTypeCode());
744:                        } else {
745:                            salesTax = origSalesTax;
746:                        }
747:                    }
748:
749:                    // object references
750:                    setChart((Chart) ObjectUtils.deepCopy(other.getChart()));
751:                    setAccount((Account) ObjectUtils.deepCopy(other
752:                            .getAccount()));
753:                    setObjectCode((ObjectCode) ObjectUtils.deepCopy(other
754:                            .getObjectCode()));
755:                    setSubAccount((SubAccount) ObjectUtils.deepCopy(other
756:                            .getSubAccount()));
757:                    setSubObjectCode((SubObjCd) ObjectUtils.deepCopy(other
758:                            .getSubObjectCode()));
759:                    setProject((ProjectCode) ObjectUtils.deepCopy(other
760:                            .getProject()));
761:                    setBalanceTyp((BalanceTyp) ObjectUtils.deepCopy(other
762:                            .getBalanceTyp()));
763:                    setObjectType((ObjectType) ObjectUtils.deepCopy(other
764:                            .getObjectType()));
765:                }
766:            }
767:
768:            /**
769:             * @see org.kuali.core.bo.AccountingLine#isLike(org.kuali.core.bo.AccountingLine)
770:             */
771:            public boolean isLike(AccountingLine other) {
772:                boolean isLike = false;
773:
774:                if (other != null) {
775:                    if (other == this ) {
776:                        isLike = true;
777:                    } else {
778:                        Map this Values = this .getValuesMap();
779:                        Map otherValues = other.getValuesMap();
780:
781:                        isLike = this Values.equals(otherValues);
782:
783:                        if (!isLike && LOG.isDebugEnabled()) {
784:                            StringBuffer inequalities = new StringBuffer();
785:                            boolean first = true;
786:
787:                            for (Iterator i = this Values.keySet().iterator(); i
788:                                    .hasNext();) {
789:                                String key = (String) i.next();
790:
791:                                Object this Value = this Values.get(key);
792:                                Object otherValue = otherValues.get(key);
793:                                if (!org.apache.commons.lang.ObjectUtils
794:                                        .equals(this Value, otherValue)) {
795:                                    inequalities.append(key + "(" + this Value
796:                                            + " != " + otherValue + ")");
797:
798:                                    if (first) {
799:                                        first = false;
800:                                    } else {
801:                                        inequalities.append(",");
802:                                    }
803:                                }
804:                            }
805:
806:                            LOG.debug("inequalities: " + inequalities);
807:                        }
808:                    }
809:                }
810:
811:                return isLike;
812:            }
813:
814:            /**
815:             * @see AccountingLine#getAccountExpiredOverride()
816:             */
817:            public boolean getAccountExpiredOverride() {
818:                return accountExpiredOverride;
819:            }
820:
821:            /**
822:             * @see AccountingLine#setAccountExpiredOverride(boolean)
823:             */
824:            public void setAccountExpiredOverride(boolean b) {
825:                accountExpiredOverride = b;
826:            }
827:
828:            /**
829:             * @see AccountingLine#getAccountExpiredOverrideNeeded()
830:             */
831:            public boolean getAccountExpiredOverrideNeeded() {
832:                return accountExpiredOverrideNeeded;
833:            }
834:
835:            /**
836:             * @see AccountingLine#setAccountExpiredOverrideNeeded(boolean)
837:             */
838:            public void setAccountExpiredOverrideNeeded(boolean b) {
839:                accountExpiredOverrideNeeded = b;
840:            }
841:
842:            /**
843:             * @return Returns the objectBudgetOverride.
844:             */
845:            public boolean isObjectBudgetOverride() {
846:                return objectBudgetOverride;
847:            }
848:
849:            /**
850:             * @param objectBudgetOverride The objectBudgetOverride to set.
851:             */
852:            public void setObjectBudgetOverride(boolean objectBudgetOverride) {
853:                this .objectBudgetOverride = objectBudgetOverride;
854:            }
855:
856:            /**
857:             * @return Returns the objectBudgetOverrideNeeded.
858:             */
859:            public boolean isObjectBudgetOverrideNeeded() {
860:                return objectBudgetOverrideNeeded;
861:            }
862:
863:            /**
864:             * @param objectBudgetOverrideNeeded The objectBudgetOverrideNeeded to set.
865:             */
866:            public void setObjectBudgetOverrideNeeded(
867:                    boolean objectBudgetOverrideNeeded) {
868:                this .objectBudgetOverrideNeeded = objectBudgetOverrideNeeded;
869:            }
870:
871:            /**
872:             * @see org.kuali.kfs.bo.AccountingLine#isNonFringeAccountOverride()
873:             */
874:            public boolean getNonFringeAccountOverride() {
875:                return nonFringeAccountOverride;
876:            }
877:
878:            /**
879:             * @see org.kuali.kfs.bo.AccountingLine#setNonFringeAccountOverride(boolean)
880:             */
881:            public void setNonFringeAccountOverride(
882:                    boolean nonFringeAccountOverride) {
883:                this .nonFringeAccountOverride = nonFringeAccountOverride;
884:            }
885:
886:            /**
887:             * @see org.kuali.kfs.bo.AccountingLine#isNonFringeAccountOverrideNeeded()
888:             */
889:            public boolean getNonFringeAccountOverrideNeeded() {
890:                return nonFringeAccountOverrideNeeded;
891:            }
892:
893:            /**
894:             * @see org.kuali.kfs.bo.AccountingLine#setNonFringeAccountOverrideNeeded(boolean)
895:             */
896:            public void setNonFringeAccountOverrideNeeded(
897:                    boolean nonFringeAccountOverrideNeeded) {
898:                this .nonFringeAccountOverrideNeeded = nonFringeAccountOverrideNeeded;
899:            }
900:
901:            /**
902:             * Returns a map with the primitive field names as the key and the primitive values as the map value.
903:             * 
904:             * @return Map
905:             */
906:            public Map getValuesMap() {
907:                Map simpleValues = new HashMap();
908:
909:                simpleValues.put("sequenceNumber", getSequenceNumber());
910:                simpleValues.put(KFSPropertyConstants.DOCUMENT_NUMBER,
911:                        getDocumentNumber());
912:                simpleValues.put("postingYear", getPostingYear());
913:                simpleValues.put("amount", getAmount());
914:                simpleValues.put("referenceOriginCode",
915:                        getReferenceOriginCode());
916:                simpleValues.put("referenceNumber", getReferenceNumber());
917:                simpleValues.put("referenceTypeCode", getReferenceTypeCode());
918:                simpleValues.put("overrideCode", getOverrideCode());
919:                // The override booleans are not in the map because they should not cause isLike() to fail and generate update events.
920:                simpleValues.put("organizationReferenceId",
921:                        getOrganizationReferenceId());
922:                simpleValues.put("debitCreditCode", getDebitCreditCode());
923:                simpleValues.put("encumbranceUpdateCode",
924:                        getEncumbranceUpdateCode());
925:                simpleValues.put("financialDocumentLineTypeCode",
926:                        getFinancialDocumentLineTypeCode());
927:                simpleValues.put("financialDocumentLineDescription",
928:                        getFinancialDocumentLineDescription());
929:
930:                simpleValues.put("chartOfAccountsCode",
931:                        getChartOfAccountsCode());
932:                simpleValues.put("accountNumber", getAccountNumber());
933:                simpleValues.put("financialObjectCode",
934:                        getFinancialObjectCode());
935:                simpleValues.put("subAccountNumber", getSubAccountNumber());
936:                simpleValues.put("financialSubObjectCode",
937:                        getFinancialSubObjectCode());
938:                simpleValues.put("projectCode", getProjectCode());
939:                simpleValues.put("balanceTypeCode", getBalanceTypeCode());
940:                simpleValues.put("objectTypeCode", getObjectTypeCode());
941:
942:                return simpleValues;
943:            }
944:
945:            /**
946:             * Override needed for PURAP GL entry creation (hjs) - please do not add "amount" to this method
947:             * 
948:             * @see java.lang.Object#equals(java.lang.Object)
949:             */
950:            public boolean equals(Object obj) {
951:                if (!(obj instanceof  AccountingLine)) {
952:                    return false;
953:                }
954:                AccountingLine accountingLine = (AccountingLine) obj;
955:                return new EqualsBuilder().append(this .chartOfAccountsCode,
956:                        accountingLine.getChartOfAccountsCode()).append(
957:                        this .accountNumber, accountingLine.getAccountNumber())
958:                        .append(this .subAccountNumber,
959:                                accountingLine.getSubAccountNumber()).append(
960:                                this .financialObjectCode,
961:                                accountingLine.getFinancialObjectCode())
962:                        .append(this .financialSubObjectCode,
963:                                accountingLine.getFinancialSubObjectCode())
964:                        .append(this .projectCode,
965:                                accountingLine.getProjectCode()).append(
966:                                this .organizationReferenceId,
967:                                accountingLine.getOrganizationReferenceId())
968:                        .isEquals();
969:            }
970:
971:            /**
972:             * Override needed for PURAP GL entry creation (hjs) - please do not add "amount" to this method
973:             * 
974:             * @see java.lang.Object#hashCode()
975:             */
976:            public int hashCode() {
977:                return new HashCodeBuilder(37, 41).append(
978:                        this.chartOfAccountsCode).append(this.accountNumber)
979:                        .append(this.subAccountNumber).append(
980:                                this.financialObjectCode).append(
981:                                this.financialSubObjectCode).append(
982:                                this.projectCode).append(
983:                                this.organizationReferenceId).toHashCode();
984:            }
985:
986:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.