001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.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/ecl2.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.module.cab.businessobject;
017    
018    import java.sql.Date;
019    import java.sql.Timestamp;
020    import java.util.LinkedHashMap;
021    import java.util.List;
022    
023    import org.kuali.kfs.coa.businessobject.Account;
024    import org.kuali.kfs.coa.businessobject.Chart;
025    import org.kuali.kfs.coa.businessobject.ObjectCode;
026    import org.kuali.kfs.coa.businessobject.ObjectType;
027    import org.kuali.kfs.coa.businessobject.SubAccount;
028    import org.kuali.kfs.coa.businessobject.SubObjectCode;
029    import org.kuali.kfs.gl.businessobject.Entry;
030    import org.kuali.kfs.module.cab.CabConstants;
031    import org.kuali.kfs.sys.KFSConstants;
032    import org.kuali.kfs.sys.KFSPropertyConstants;
033    import org.kuali.kfs.sys.context.SpringContext;
034    import org.kuali.rice.kew.doctype.bo.DocumentTypeEBO;
035    import org.kuali.rice.kew.service.impl.KEWModuleService;
036    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
037    import org.kuali.rice.kns.util.KualiDecimal;
038    import org.kuali.rice.kns.util.TypedArrayList;
039    
040    public class GeneralLedgerEntry extends PersistableBusinessObjectBase {
041        private Long generalLedgerAccountIdentifier;
042        private Integer universityFiscalYear;
043        private String chartOfAccountsCode;
044        private String accountNumber;
045        private String subAccountNumber;
046        private String financialObjectCode;
047        private String financialSubObjectCode;
048        private String financialBalanceTypeCode;
049        private String financialObjectTypeCode;
050        private String universityFiscalPeriodCode;
051        private String financialDocumentTypeCode;
052        private String financialSystemOriginationCode;
053        private String documentNumber;
054        private Integer transactionLedgerEntrySequenceNumber;
055        private String transactionLedgerEntryDescription;
056        private KualiDecimal transactionLedgerEntryAmount;
057        private KualiDecimal transactionLedgerSubmitAmount;
058        private String organizationReferenceId;
059        private String referenceFinancialSystemOriginationCode;
060        private String referenceFinancialDocumentNumber;
061        private String transactionDebitCreditCode;
062        private String organizationDocumentNumber;
063        private String projectCode;
064        private Date transactionPostingDate;
065        private Date transactionDate;
066        private Timestamp transactionDateTimeStamp;
067        private String activityStatusCode;
068    
069        // References
070        private Account account;
071        private Chart chart;
072        private ObjectCode financialObject;
073        private SubAccount subAccount;
074        private SubObjectCode financialSubObject;
075        private ObjectType objectType;
076        private DocumentTypeEBO financialSystemDocumentTypeCode;
077    
078        private List<GeneralLedgerEntryAsset> generalLedgerEntryAssets;
079        private List<PurchasingAccountsPayableLineAssetAccount> purApLineAssetAccounts;
080        // non-db fields
081        private boolean selected;
082        private KualiDecimal amount;
083        private boolean active;
084    
085        public GeneralLedgerEntry() {
086            this.generalLedgerEntryAssets = new TypedArrayList(GeneralLedgerEntryAsset.class);
087            this.purApLineAssetAccounts = new TypedArrayList(PurchasingAccountsPayableLineAssetAccount.class);
088        }
089    
090        /**
091         * Constructs a GeneralLedgerEntry item from GL line entry
092         * 
093         * @param entry GL Lines
094         */
095        public GeneralLedgerEntry(Entry entry) {
096            this.generalLedgerEntryAssets = new TypedArrayList(GeneralLedgerEntryAsset.class);
097            this.setUniversityFiscalYear(entry.getUniversityFiscalYear());
098            this.setChartOfAccountsCode(entry.getChartOfAccountsCode());
099            this.setAccountNumber(entry.getAccountNumber());
100            this.setSubAccountNumber(entry.getSubAccountNumber());
101            this.setFinancialObjectCode(entry.getFinancialObjectCode());
102            this.setFinancialSubObjectCode(entry.getFinancialSubObjectCode());
103            this.setFinancialBalanceTypeCode(entry.getFinancialBalanceTypeCode());
104            this.setFinancialObjectTypeCode(entry.getFinancialObjectTypeCode());
105            this.setUniversityFiscalPeriodCode(entry.getUniversityFiscalPeriodCode());
106            this.setFinancialDocumentTypeCode(entry.getFinancialDocumentTypeCode());
107            this.setFinancialSystemOriginationCode(entry.getFinancialSystemOriginationCode());
108            this.setDocumentNumber(entry.getDocumentNumber());
109            this.setTransactionLedgerEntrySequenceNumber(entry.getTransactionLedgerEntrySequenceNumber());
110            this.setTransactionLedgerEntryDescription(entry.getTransactionLedgerEntryDescription());
111            this.setTransactionLedgerEntryAmount(entry.getTransactionLedgerEntryAmount());
112            this.setOrganizationReferenceId(entry.getOrganizationReferenceId());
113            this.setReferenceFinancialSystemOriginationCode(entry.getReferenceFinancialSystemOriginationCode());
114            this.setReferenceFinancialDocumentNumber(entry.getReferenceFinancialDocumentNumber());
115            this.setTransactionDebitCreditCode(entry.getTransactionDebitCreditCode());
116            this.setOrganizationDocumentNumber(entry.getOrganizationDocumentNumber());
117            this.setProjectCode(entry.getProjectCode());
118            this.setTransactionDate(entry.getTransactionDate());
119            this.setTransactionPostingDate(entry.getTransactionPostingDate());
120            this.setTransactionDateTimeStamp(entry.getTransactionDateTimeStamp());
121            this.setActivityStatusCode(CabConstants.ActivityStatusCode.NEW);
122        }
123    
124        @Override
125        protected LinkedHashMap<String, String> toStringMapper() {
126            LinkedHashMap<String, String> m = new LinkedHashMap<String, String>();
127            if (this.generalLedgerAccountIdentifier != null) {
128                m.put("generalLedgerAccountIdentifier", this.generalLedgerAccountIdentifier.toString());
129            }
130            m.put("universityFiscalYear", this.universityFiscalYear.toString());
131            m.put("chartOfAccountsCode", this.chartOfAccountsCode);
132            m.put("accountNumber", this.accountNumber);
133            m.put("subAccountNumber", this.subAccountNumber);
134            m.put("financialObjectCode", this.financialObjectCode);
135            m.put("financialSubObjectCode", this.financialSubObjectCode);
136            m.put("financialBalanceTypeCode", this.financialBalanceTypeCode);
137            m.put("financialObjectTypeCode", this.financialObjectTypeCode);
138            m.put("universityFiscalPeriodCode", this.universityFiscalPeriodCode);
139            m.put("financialDocumentTypeCode", this.financialDocumentTypeCode);
140            m.put("financialSystemOriginationCode", this.financialSystemOriginationCode);
141            m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
142            m.put("transactionLedgerEntrySequenceNumber", this.transactionLedgerEntrySequenceNumber.toString());
143            return m;
144        }
145    
146        /**
147         * Gets the generalLedgerAccountIdentifier attribute.
148         * 
149         * @return Returns the generalLedgerAccountIdentifier
150         */
151        public Long getGeneralLedgerAccountIdentifier() {
152            return generalLedgerAccountIdentifier;
153        }
154    
155    
156        /**
157         * Sets the generalLedgerAccountIdentifier attribute.
158         * 
159         * @param generalLedgerAccountIdentifier The generalLedgerAccountIdentifier to set.
160         */
161        public void setGeneralLedgerAccountIdentifier(Long glAccountId) {
162            this.generalLedgerAccountIdentifier = glAccountId;
163        }
164    
165        /**
166         * Gets the universityFiscalYear attribute.
167         * 
168         * @return Returns the universityFiscalYear
169         */
170        public Integer getUniversityFiscalYear() {
171            return universityFiscalYear;
172        }
173    
174        /**
175         * Sets the universityFiscalYear attribute.
176         * 
177         * @param universityFiscalYear The universityFiscalYear to set.
178         */
179        public void setUniversityFiscalYear(Integer universityFiscalYear) {
180            this.universityFiscalYear = universityFiscalYear;
181        }
182    
183        /**
184         * Gets the chartOfAccountsCode attribute.
185         * 
186         * @return Returns the chartOfAccountsCode
187         */
188        public String getChartOfAccountsCode() {
189            return chartOfAccountsCode;
190        }
191    
192        /**
193         * Sets the chartOfAccountsCode attribute.
194         * 
195         * @param chartOfAccountsCode The chartOfAccountsCode to set.
196         */
197        public void setChartOfAccountsCode(String chartOfAccountsCode) {
198            this.chartOfAccountsCode = chartOfAccountsCode;
199        }
200    
201        /**
202         * Gets the accountNumber attribute.
203         * 
204         * @return Returns the accountNumber
205         */
206        public String getAccountNumber() {
207            return accountNumber;
208        }
209    
210        /**
211         * Sets the accountNumber attribute.
212         * 
213         * @param accountNumber The accountNumber to set.
214         */
215        public void setAccountNumber(String accountNumber) {
216            this.accountNumber = accountNumber;
217        }
218    
219        /**
220         * Gets the subAccountNumber attribute.
221         * 
222         * @return Returns the subAccountNumber
223         */
224        public String getSubAccountNumber() {
225            return subAccountNumber;
226        }
227    
228        /**
229         * Sets the subAccountNumber attribute.
230         * 
231         * @param subAccountNumber The subAccountNumber to set.
232         */
233        public void setSubAccountNumber(String subAccountNumber) {
234            this.subAccountNumber = subAccountNumber;
235        }
236    
237        /**
238         * Gets the financialObjectCode attribute.
239         * 
240         * @return Returns the financialObjectCode
241         */
242        public String getFinancialObjectCode() {
243            return financialObjectCode;
244        }
245    
246        /**
247         * Sets the financialObjectCode attribute.
248         * 
249         * @param financialObjectCode The financialObjectCode to set.
250         */
251        public void setFinancialObjectCode(String financialObjectCode) {
252            this.financialObjectCode = financialObjectCode;
253        }
254    
255        /**
256         * Gets the financialSubObjectCode attribute.
257         * 
258         * @return Returns the financialSubObjectCode
259         */
260        public String getFinancialSubObjectCode() {
261            return financialSubObjectCode;
262        }
263    
264        /**
265         * Sets the financialSubObjectCode attribute.
266         * 
267         * @param financialSubObjectCode The financialSubObjectCode to set.
268         */
269        public void setFinancialSubObjectCode(String financialSubObjectCode) {
270            this.financialSubObjectCode = financialSubObjectCode;
271        }
272    
273        /**
274         * Gets the financialBalanceTypeCode attribute.
275         * 
276         * @return Returns the financialBalanceTypeCode
277         */
278        public String getFinancialBalanceTypeCode() {
279            return financialBalanceTypeCode;
280        }
281    
282        /**
283         * Sets the financialBalanceTypeCode attribute.
284         * 
285         * @param financialBalanceTypeCode The financialBalanceTypeCode to set.
286         */
287        public void setFinancialBalanceTypeCode(String financialBalanceTypeCode) {
288            this.financialBalanceTypeCode = financialBalanceTypeCode;
289        }
290    
291        /**
292         * Gets the financialObjectTypeCode attribute.
293         * 
294         * @return Returns the financialObjectTypeCode
295         */
296        public String getFinancialObjectTypeCode() {
297            return financialObjectTypeCode;
298        }
299    
300        /**
301         * Sets the financialObjectTypeCode attribute.
302         * 
303         * @param financialObjectTypeCode The financialObjectTypeCode to set.
304         */
305        public void setFinancialObjectTypeCode(String financialObjectTypeCode) {
306            this.financialObjectTypeCode = financialObjectTypeCode;
307        }
308    
309        /**
310         * Gets the universityFiscalPeriodCode attribute.
311         * 
312         * @return Returns the universityFiscalPeriodCode
313         */
314        public String getUniversityFiscalPeriodCode() {
315            return universityFiscalPeriodCode;
316        }
317    
318        /**
319         * Sets the universityFiscalPeriodCode attribute.
320         * 
321         * @param universityFiscalPeriodCode The universityFiscalPeriodCode to set.
322         */
323        public void setUniversityFiscalPeriodCode(String universityFiscalPeriodCode) {
324            this.universityFiscalPeriodCode = universityFiscalPeriodCode;
325        }
326    
327        /**
328         * Gets the financialDocumentTypeCode attribute.
329         * 
330         * @return Returns the financialDocumentTypeCode
331         */
332        public String getFinancialDocumentTypeCode() {
333            return financialDocumentTypeCode;
334        }
335    
336        /**
337         * Sets the financialDocumentTypeCode attribute.
338         * 
339         * @param financialDocumentTypeCode The financialDocumentTypeCode to set.
340         */
341        public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
342            this.financialDocumentTypeCode = financialDocumentTypeCode;
343        }
344    
345        /**
346         * Gets the financialSystemOriginationCode attribute.
347         * 
348         * @return Returns the financialSystemOriginationCode
349         */
350        public String getFinancialSystemOriginationCode() {
351            return financialSystemOriginationCode;
352        }
353    
354        /**
355         * Sets the financialSystemOriginationCode attribute.
356         * 
357         * @param financialSystemOriginationCode The financialSystemOriginationCode to set.
358         */
359        public void setFinancialSystemOriginationCode(String financialSystemOriginationCode) {
360            this.financialSystemOriginationCode = financialSystemOriginationCode;
361        }
362    
363        /**
364         * Gets the documentNumber attribute.
365         * 
366         * @return Returns the documentNumber
367         */
368        public String getDocumentNumber() {
369            return documentNumber;
370        }
371    
372    
373        /**
374         * Sets the documentNumber attribute.
375         * 
376         * @param documentNumber The documentNumber to set.
377         */
378        public void setDocumentNumber(String documentNumber) {
379            this.documentNumber = documentNumber;
380        }
381    
382        /**
383         * Gets the transactionLedgerEntrySequenceNumber attribute.
384         * 
385         * @return Returns the transactionLedgerEntrySequenceNumber
386         */
387        public Integer getTransactionLedgerEntrySequenceNumber() {
388            return transactionLedgerEntrySequenceNumber;
389        }
390    
391        /**
392         * Sets the transactionLedgerEntrySequenceNumber attribute.
393         * 
394         * @param transactionLedgerEntrySequenceNumber The transactionLedgerEntrySequenceNumber to set.
395         */
396        public void setTransactionLedgerEntrySequenceNumber(Integer transactionLedgerEntrySequenceNumber) {
397            this.transactionLedgerEntrySequenceNumber = transactionLedgerEntrySequenceNumber;
398        }
399    
400        /**
401         * Gets the transactionLedgerEntryDescription attribute.
402         * 
403         * @return Returns the transactionLedgerEntryDescription
404         */
405        public String getTransactionLedgerEntryDescription() {
406            return transactionLedgerEntryDescription;
407        }
408    
409        /**
410         * Sets the transactionLedgerEntryDescription attribute.
411         * 
412         * @param transactionLedgerEntryDescription The transactionLedgerEntryDescription to set.
413         */
414        public void setTransactionLedgerEntryDescription(String transactionLedgerEntryDescription) {
415            this.transactionLedgerEntryDescription = transactionLedgerEntryDescription;
416        }
417    
418        /**
419         * Gets the transactionLedgerEntryAmount attribute.
420         * 
421         * @return Returns the transactionLedgerEntryAmount
422         */
423        public KualiDecimal getTransactionLedgerEntryAmount() {
424            return transactionLedgerEntryAmount;
425        }
426    
427        /**
428         * Sets the transactionLedgerEntryAmount attribute.
429         * 
430         * @param transactionLedgerEntryAmount The transactionLedgerEntryAmount to set.
431         */
432        public void setTransactionLedgerEntryAmount(KualiDecimal transactionLedgerEntryAmount) {
433            this.transactionLedgerEntryAmount = transactionLedgerEntryAmount;
434        }
435    
436        /**
437         * Gets the organizationReferenceId attribute.
438         * 
439         * @return Returns the organizationReferenceId
440         */
441        public String getOrganizationReferenceId() {
442            return organizationReferenceId;
443        }
444    
445        /**
446         * Sets the organizationReferenceId attribute.
447         * 
448         * @param organizationReferenceId The organizationReferenceId to set.
449         */
450        public void setOrganizationReferenceId(String organizationReferenceId) {
451            this.organizationReferenceId = organizationReferenceId;
452        }
453    
454        /**
455         * Gets the referenceFinancialSystemOriginationCode attribute.
456         * 
457         * @return Returns the referenceFinancialSystemOriginationCode
458         */
459        public String getReferenceFinancialSystemOriginationCode() {
460            return referenceFinancialSystemOriginationCode;
461        }
462    
463        /**
464         * Sets the referenceFinancialSystemOriginationCode attribute.
465         * 
466         * @param referenceFinancialSystemOriginationCode The referenceFinancialSystemOriginationCode to set.
467         */
468        public void setReferenceFinancialSystemOriginationCode(String referenceFinancialSystemOriginationCode) {
469            this.referenceFinancialSystemOriginationCode = referenceFinancialSystemOriginationCode;
470        }
471    
472        /**
473         * Gets the referenceFinancialDocumentNumber attribute.
474         * 
475         * @return Returns the referenceFinancialDocumentNumber
476         */
477        public String getReferenceFinancialDocumentNumber() {
478            return referenceFinancialDocumentNumber;
479        }
480    
481        /**
482         * Sets the referenceFinancialDocumentNumber attribute.
483         * 
484         * @param referenceFinancialDocumentNumber The referenceFinancialDocumentNumber to set.
485         */
486        public void setReferenceFinancialDocumentNumber(String referenceFinancialDocumentNumber) {
487            this.referenceFinancialDocumentNumber = referenceFinancialDocumentNumber;
488        }
489    
490        /**
491         * Gets the transactionDebitCreditCode attribute.
492         * 
493         * @return Returns the transactionDebitCreditCode
494         */
495        public String getTransactionDebitCreditCode() {
496            return transactionDebitCreditCode;
497        }
498    
499        /**
500         * Sets the transactionDebitCreditCode attribute.
501         * 
502         * @param transactionDebitCreditCode The transactionDebitCreditCode to set.
503         */
504        public void setTransactionDebitCreditCode(String transactionDebitCreditCode) {
505            this.transactionDebitCreditCode = transactionDebitCreditCode;
506        }
507    
508        /**
509         * Gets the organizationDocumentNumber attribute.
510         * 
511         * @return Returns the organizationDocumentNumber
512         */
513        public String getOrganizationDocumentNumber() {
514            return organizationDocumentNumber;
515        }
516    
517        /**
518         * Sets the organizationDocumentNumber attribute.
519         * 
520         * @param organizationDocumentNumber The organizationDocumentNumber to set.
521         */
522        public void setOrganizationDocumentNumber(String organizationDocumentNumber) {
523            this.organizationDocumentNumber = organizationDocumentNumber;
524        }
525    
526        /**
527         * Gets the projectCode attribute.
528         * 
529         * @return Returns the projectCode
530         */
531        public String getProjectCode() {
532            return projectCode;
533        }
534    
535        /**
536         * Sets the projectCode attribute.
537         * 
538         * @param projectCode The projectCode to set.
539         */
540        public void setProjectCode(String projectCode) {
541            this.projectCode = projectCode;
542        }
543    
544        /**
545         * Gets the transactionPostingDate attribute.
546         * 
547         * @return Returns the transactionPostingDate
548         */
549        public Date getTransactionPostingDate() {
550            return transactionPostingDate;
551        }
552    
553        /**
554         * Sets the transactionPostingDate attribute.
555         * 
556         * @param transactionPostingDate The transactionPostingDate to set.
557         */
558        public void setTransactionPostingDate(Date transactionPostingDate) {
559            this.transactionPostingDate = transactionPostingDate;
560        }
561    
562        /**
563         * Gets the transactionDateTimeStamp attribute.
564         * 
565         * @return Returns the transactionDateTimeStamp
566         */
567        public Timestamp getTransactionDateTimeStamp() {
568            return transactionDateTimeStamp;
569        }
570    
571        /**
572         * Sets the transactionDateTimeStamp attribute.
573         * 
574         * @param transactionDateTimeStamp The transactionDateTimeStamp to set.
575         */
576        public void setTransactionDateTimeStamp(Timestamp transactionDateTimeStamp) {
577            this.transactionDateTimeStamp = transactionDateTimeStamp;
578        }
579    
580        /**
581         * Gets the account attribute.
582         * 
583         * @return Returns the account
584         */
585        public Account getAccount() {
586            return account;
587        }
588    
589        /**
590         * Sets the account attribute.
591         * 
592         * @param account The account to set.
593         */
594        public void setAccount(Account account) {
595            this.account = account;
596        }
597    
598        /**
599         * Gets the subAccount attribute.
600         * 
601         * @return Returns the subAccount
602         */
603        public SubAccount getSubAccount() {
604            return subAccount;
605        }
606    
607        /**
608         * Sets the subAccount attribute.
609         * 
610         * @param subAccount The subAccount to set.
611         */
612        public void setSubAccount(SubAccount subAccount) {
613            this.subAccount = subAccount;
614        }
615    
616    
617        /**
618         * Gets the chart attribute.
619         * 
620         * @return Returns the chart
621         */
622        public Chart getChart() {
623            return chart;
624        }
625    
626        /**
627         * Sets the chart attribute.
628         * 
629         * @param chart The chart to set.
630         */
631        public void setChart(Chart chart) {
632            this.chart = chart;
633        }
634    
635        /**
636         * Gets the financialObject attribute.
637         * 
638         * @return Returns the financialObject
639         */
640        public ObjectCode getFinancialObject() {
641            return financialObject;
642        }
643    
644        /**
645         * Sets the financialObject attribute.
646         * 
647         * @param financialObject The financialObject to set.
648         */
649        public void setFinancialObject(ObjectCode financialObject) {
650            this.financialObject = financialObject;
651        }
652    
653        /**
654         * Gets the financialSubObject attribute.
655         * 
656         * @return Returns the financialSubObject
657         */
658        public SubObjectCode getFinancialSubObject() {
659            return financialSubObject;
660        }
661    
662        /**
663         * Sets the financialSubObject attribute.
664         * 
665         * @param financialSubObject The financialSubObject to set.
666         */
667        public void setFinancialSubObject(SubObjectCode financialSubObject) {
668            this.financialSubObject = financialSubObject;
669        }
670    
671        /**
672         * Gets the objectType attribute.
673         * 
674         * @return Returns the objectType
675         */
676        public ObjectType getObjectType() {
677            return objectType;
678        }
679    
680        /**
681         * Sets the objectType attribute.
682         * 
683         * @param objectType The objectType to set.
684         */
685        public void setObjectType(ObjectType objectType) {
686            this.objectType = objectType;
687        }
688    
689        /**
690         * Gets the financialSystemDocumentTypeCode attribute.
691         * 
692         * @return Returns the financialSystemDocumentTypeCode.
693         */
694        public DocumentTypeEBO getFinancialSystemDocumentTypeCode() {
695            return financialSystemDocumentTypeCode = SpringContext.getBean(KEWModuleService.class).retrieveExternalizableBusinessObjectIfNecessary(this, financialSystemDocumentTypeCode, "financialSystemDocumentTypeCode");
696        }
697    
698        /**
699         * Gets the active attribute.
700         * 
701         * @return Returns the active
702         */
703        public boolean isActive() {
704            return CabConstants.ActivityStatusCode.NEW.equalsIgnoreCase(this.getActivityStatusCode()) || CabConstants.ActivityStatusCode.MODIFIED.equalsIgnoreCase(this.getActivityStatusCode());
705        }
706    
707    
708        /**
709         * Gets the activityStatusCode attribute.
710         * 
711         * @return Returns the activityStatusCode.
712         */
713        public String getActivityStatusCode() {
714            return activityStatusCode;
715        }
716    
717        /**
718         * Sets the activityStatusCode attribute value.
719         * 
720         * @param activityStatusCode The activityStatusCode to set.
721         */
722        public void setActivityStatusCode(String activityStatusCode) {
723            this.activityStatusCode = activityStatusCode;
724        }
725    
726        /**
727         * Gets the generalLedgerEntryAssets attribute.
728         * 
729         * @return Returns the generalLedgerEntryAssets
730         */
731    
732        public List<GeneralLedgerEntryAsset> getGeneralLedgerEntryAssets() {
733            return generalLedgerEntryAssets;
734        }
735    
736        /**
737         * Sets the generalLedgerEntryAssets attribute.
738         * 
739         * @param generalLedgerEntryAssets The generalLedgerEntryAssets to set.
740         */
741    
742        public void setGeneralLedgerEntryAssets(List<GeneralLedgerEntryAsset> generalLedgerEntryAssets) {
743            this.generalLedgerEntryAssets = generalLedgerEntryAssets;
744        }
745    
746        /**
747         * Gets the transactionDate attribute.
748         * 
749         * @return Returns the transactionDate
750         */
751    
752        public Date getTransactionDate() {
753            return transactionDate;
754        }
755    
756        /**
757         * Sets the transactionDate attribute.
758         * 
759         * @param transactionDate The transactionDate to set.
760         */
761    
762        public void setTransactionDate(Date transactionDate) {
763            this.transactionDate = transactionDate;
764        }
765    
766        /**
767         * Gets the purApLineAssetAccounts attribute.
768         * 
769         * @return Returns the purApLineAssetAccounts.
770         */
771        public List<PurchasingAccountsPayableLineAssetAccount> getPurApLineAssetAccounts() {
772            return purApLineAssetAccounts;
773        }
774    
775        /**
776         * Sets the purApLineAssetAccounts attribute value.
777         * 
778         * @param purApLineAssetAccounts The purApLineAssetAccounts to set.
779         */
780        public void setPurApLineAssetAccounts(List<PurchasingAccountsPayableLineAssetAccount> purApLineAssetAccounts) {
781            this.purApLineAssetAccounts = purApLineAssetAccounts;
782        }
783    
784        public KualiDecimal computePayment() {
785            KualiDecimal absAmount = getTransactionLedgerEntryAmount();
786            if (absAmount == null) {
787                return null;
788            }
789            return KFSConstants.GL_CREDIT_CODE.equals(getTransactionDebitCreditCode()) ? absAmount.negated() : absAmount;
790        }
791    
792        /**
793         * Gets the selected attribute.
794         * 
795         * @return Returns the selected.
796         */
797        public boolean isSelected() {
798            return selected;
799        }
800    
801        /**
802         * Sets the selected attribute value.
803         * 
804         * @param selected The selected to set.
805         */
806        public void setSelected(boolean selected) {
807            this.selected = selected;
808        }
809    
810        /**
811         * Gets the amount attribute.
812         * 
813         * @return Returns the amount.
814         */
815        public KualiDecimal getAmount() {
816            if (getTransactionLedgerEntryAmount() != null && KFSConstants.GL_CREDIT_CODE.equals(getTransactionDebitCreditCode())) {
817                setAmount(getTransactionLedgerEntryAmount().negated());
818            }
819            else {
820                setAmount(getTransactionLedgerEntryAmount());
821            }
822            return amount;
823        }
824    
825        /**
826         * Sets the amount attribute value.
827         * 
828         * @param amount The amount to set.
829         */
830        public void setAmount(KualiDecimal absAmount) {
831            this.amount = absAmount;
832        }
833    
834        /**
835         * Gets the transactionLedgerSubmitAmount attribute.
836         * 
837         * @return Returns the transactionLedgerSubmitAmount.
838         */
839        public KualiDecimal getTransactionLedgerSubmitAmount() {
840            return transactionLedgerSubmitAmount;
841        }
842    
843        /**
844         * Sets the transactionLedgerSubmitAmount attribute value.
845         * 
846         * @param transactionLedgerSubmitAmount The transactionLedgerSubmitAmount to set.
847         */
848        public void setTransactionLedgerSubmitAmount(KualiDecimal transactionLedgerSubmitAmount) {
849            this.transactionLedgerSubmitAmount = transactionLedgerSubmitAmount;
850        }
851    }