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.cam.document;
017    
018    import java.util.ArrayList;
019    import java.util.HashMap;
020    import java.util.LinkedHashMap;
021    import java.util.List;
022    import java.util.Map;
023    
024    import org.apache.commons.lang.StringUtils;
025    import org.kuali.kfs.coa.businessobject.Account;
026    import org.kuali.kfs.coa.businessobject.Chart;
027    import org.kuali.kfs.fp.document.TransferOfFundsDocument;
028    import org.kuali.kfs.integration.cam.CapitalAssetManagementModuleService;
029    import org.kuali.kfs.module.cam.CamsConstants;
030    import org.kuali.kfs.module.cam.businessobject.Asset;
031    import org.kuali.kfs.module.cam.businessobject.AssetGlpeSourceDetail;
032    import org.kuali.kfs.module.cam.document.service.AssetTransferService;
033    import org.kuali.kfs.sys.KFSPropertyConstants;
034    import org.kuali.kfs.sys.businessobject.Building;
035    import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry;
036    import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySequenceHelper;
037    import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySourceDetail;
038    import org.kuali.kfs.sys.businessobject.Room;
039    import org.kuali.kfs.sys.context.SpringContext;
040    import org.kuali.kfs.sys.document.GeneralLedgerPendingEntrySource;
041    import org.kuali.kfs.sys.document.GeneralLedgerPostingDocumentBase;
042    import org.kuali.kfs.sys.service.GeneralLedgerPendingEntryService;
043    import org.kuali.rice.kew.dto.DocumentRouteStatusChangeDTO;
044    import org.kuali.rice.kim.bo.Person;
045    import org.kuali.rice.kns.bo.Campus;
046    import org.kuali.rice.kns.bo.Country;
047    import org.kuali.rice.kns.bo.PersistableBusinessObject;
048    import org.kuali.rice.kns.bo.PostalCode;
049    import org.kuali.rice.kns.bo.State;
050    import org.kuali.rice.kns.exception.ValidationException;
051    import org.kuali.rice.kns.rule.event.KualiDocumentEvent;
052    import org.kuali.rice.kns.rule.event.SaveDocumentEvent;
053    import org.kuali.rice.kns.service.BusinessObjectService;
054    import org.kuali.rice.kns.service.CountryService;
055    import org.kuali.rice.kns.service.KualiModuleService;
056    import org.kuali.rice.kns.service.PostalCodeService;
057    import org.kuali.rice.kns.service.StateService;
058    import org.kuali.rice.kns.util.KNSPropertyConstants;
059    import org.kuali.rice.kns.util.KualiDecimal;
060    import org.kuali.rice.kns.util.ObjectUtils;
061    import org.kuali.rice.kns.workflow.service.KualiWorkflowDocument;
062    
063    public class AssetTransferDocument extends GeneralLedgerPostingDocumentBase implements GeneralLedgerPendingEntrySource {
064        protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(AssetTransferDocument.class);
065        protected String hiddenFieldForError;
066        protected String representativeUniversalIdentifier;
067        protected String campusCode;
068        protected String buildingCode;
069        protected String buildingRoomNumber;
070        protected String buildingSubRoomNumber;
071        protected String organizationTagNumber;
072        protected String organizationOwnerChartOfAccountsCode;
073        protected String organizationOwnerAccountNumber;
074        protected String organizationText;
075        protected String organizationInventoryName;
076        protected String transferOfFundsFinancialDocumentNumber;
077        protected String offCampusAddress;
078        protected String offCampusCityName;
079        protected String offCampusStateCode;
080        protected String offCampusZipCode;
081        protected String oldOrganizationOwnerChartOfAccountsCode;
082        protected String oldOrganizationOwnerAccountNumber;
083        protected String offCampusName;
084        protected String offCampusCountryCode;
085        protected boolean interdepartmentalSalesIndicator;
086        protected Long capitalAssetNumber;
087        protected Person assetRepresentative;
088        protected Campus campus;
089        protected Account organizationOwnerAccount;
090        protected Account oldOrganizationOwnerAccount;
091        protected Chart organizationOwnerChartOfAccounts;
092        protected State offCampusState;
093        protected Country offCampusCountry;
094        protected Building building;
095        protected Room buildingRoom;
096        protected transient List<AssetGlpeSourceDetail> sourceAssetGlpeSourceDetails;
097        protected transient List<AssetGlpeSourceDetail> targetAssetGlpeSourceDetails;
098        protected Asset asset;
099        protected PostalCode postalZipCode;
100    
101        public AssetTransferDocument() {
102            super();
103            this.sourceAssetGlpeSourceDetails = new ArrayList<AssetGlpeSourceDetail>();
104            this.targetAssetGlpeSourceDetails = new ArrayList<AssetGlpeSourceDetail>();
105        }
106    
107    
108        /**
109         * @see org.kuali.kfs.sys.document.GeneralLedgerPendingEntrySource#customizeExplicitGeneralLedgerPendingEntry(org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySourceDetail,
110         *      org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry)
111         */
112        public void customizeExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntry explicitEntry) {
113    
114        }
115    
116        /**
117         * @see org.kuali.kfs.sys.document.GeneralLedgerPendingEntrySource#customizeOffsetGeneralLedgerPendingEntry(org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySourceDetail,
118         *      org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry, org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry)
119         */
120        public boolean customizeOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail accountingLine, GeneralLedgerPendingEntry explicitEntry, GeneralLedgerPendingEntry offsetEntry) {
121            return false;
122        }
123    
124        /**
125         * @see org.kuali.kfs.sys.document.GeneralLedgerPendingEntrySource#generateDocumentGeneralLedgerPendingEntries(org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySequenceHelper)
126         */
127        public boolean generateDocumentGeneralLedgerPendingEntries(GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
128            return true;
129        }
130    
131    
132        public Asset getAsset() {
133            return asset;
134        }
135    
136        /**
137         * Gets the assetRepresentative attribute.
138         * 
139         * @return Returns the assetRepresentative
140         */
141        public Person getAssetRepresentative() {
142            assetRepresentative = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(representativeUniversalIdentifier, assetRepresentative);
143            return assetRepresentative;
144        }
145    
146        /**
147         * Sets the assetRepresentative attribute.
148         * 
149         * @param assetRepresentative The assetRepresentative to set.
150         */
151        public void setAssetRepresentative(Person assetRepresentative) {
152            this.assetRepresentative = assetRepresentative;
153        }
154    
155        /**
156         * Gets the building attribute.
157         * 
158         * @return Returns the building.
159         */
160        public Building getBuilding() {
161            return building;
162        }
163    
164    
165        /**
166         * Gets the buildingCode attribute.
167         * 
168         * @return Returns the buildingCode
169         */
170        public String getBuildingCode() {
171            return buildingCode;
172        }
173    
174        /**
175         * Gets the buildingRoom attribute.
176         * 
177         * @return Returns the buildingRoom.
178         */
179        public Room getBuildingRoom() {
180            return buildingRoom;
181        }
182    
183    
184        /**
185         * Gets the buildingRoomNumber attribute.
186         * 
187         * @return Returns the buildingRoomNumber
188         */
189        public String getBuildingRoomNumber() {
190            return buildingRoomNumber;
191        }
192    
193        /**
194         * Gets the buildingSubRoomNumber attribute.
195         * 
196         * @return Returns the buildingSubRoomNumber
197         */
198        public String getBuildingSubRoomNumber() {
199            return buildingSubRoomNumber;
200        }
201    
202    
203        /**
204         * Gets the campus attribute.
205         * 
206         * @return Returns the campus
207         */
208        public Campus getCampus() {
209            Map<String, Object> criteria = new HashMap<String, Object>();
210            criteria.put(KNSPropertyConstants.CAMPUS_CODE, campusCode);
211            return campus = (Campus) SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(Campus.class).getExternalizableBusinessObject(Campus.class, criteria);
212        }
213    
214        /**
215         * Gets the campusCode attribute.
216         * 
217         * @return Returns the campusCode
218         */
219        public String getCampusCode() {
220            return campusCode;
221        }
222    
223        /**
224         * Gets the documentNumber attribute.
225         * 
226         * @return Returns the documentNumber
227         */
228        public String getDocumentNumber() {
229            return documentNumber;
230        }
231    
232        /**
233         * @see org.kuali.kfs.sys.document.GeneralLedgerPendingEntrySource#getGeneralLedgerPendingEntryAmountForGeneralLedgerPostable(org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySourceDetail)
234         */
235        public KualiDecimal getGeneralLedgerPendingEntryAmountForDetail(GeneralLedgerPendingEntrySourceDetail postable) {
236            return postable.getAmount().abs();
237        }
238    
239        public List<AssetGlpeSourceDetail> getSourceAssetGlpeSourceDetails() {
240            if (this.sourceAssetGlpeSourceDetails == null) {
241                this.sourceAssetGlpeSourceDetails = new ArrayList<AssetGlpeSourceDetail>();
242            }
243            return this.sourceAssetGlpeSourceDetails;
244        }
245    
246        public boolean generateGeneralLedgerPendingEntries(GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
247            GeneralLedgerPendingEntry explicitEntry = new GeneralLedgerPendingEntry();
248            SpringContext.getBean(GeneralLedgerPendingEntryService.class).populateExplicitGeneralLedgerPendingEntry(this, postable, sequenceHelper, explicitEntry);
249            customizeExplicitGeneralLedgerPendingEntry(postable, explicitEntry);
250            addPendingEntry(explicitEntry);
251            return true;
252        }
253    
254        /**
255         * Gets the offCampusAddress attribute.
256         * 
257         * @return Returns the offCampusAddress
258         */
259        public String getOffCampusAddress() {
260            return offCampusAddress;
261        }
262    
263    
264        /**
265         * Gets the offCampusCityName attribute.
266         * 
267         * @return Returns the offCampusCityName
268         */
269        public String getOffCampusCityName() {
270            return offCampusCityName;
271        }
272    
273        /**
274         * Gets the offCampusState attribute.
275         * 
276         * @return Returns the offCampusState.
277         */
278        public State getOffCampusState() {
279            offCampusState = SpringContext.getBean(StateService.class).getByPrimaryIdIfNecessary(offCampusCountryCode, offCampusStateCode, offCampusState);
280            return offCampusState;
281        }
282    
283    
284        /**
285         * Gets the offCampusStateCode attribute.
286         * 
287         * @return Returns the offCampusStateCode
288         */
289        public String getOffCampusStateCode() {
290            return offCampusStateCode;
291        }
292    
293        /**
294         * Gets the offCampusZipCode attribute.
295         * 
296         * @return Returns the offCampusZipCode
297         */
298        public String getOffCampusZipCode() {
299            return offCampusZipCode;
300        }
301    
302        /**
303         * Gets the postalZipCode attribute.
304         * 
305         * @return Returns the postalZipCode
306         */
307        public PostalCode getPostalZipCode() {
308            postalZipCode = SpringContext.getBean(PostalCodeService.class).getByPrimaryIdIfNecessary(offCampusCountryCode, offCampusZipCode, postalZipCode);
309            return postalZipCode;
310        }
311    
312        /**
313         * Gets the offCampusCountry attribute.
314         * 
315         * @return Returns the offCampusCountry.
316         */
317        public Country getOffCampusCountry() {
318            offCampusCountry = SpringContext.getBean(CountryService.class).getByPrimaryIdIfNecessary(offCampusCountryCode, offCampusCountry);
319            return offCampusCountry;
320        }
321    
322    
323        /**
324         * Gets the organizationInventoryName attribute.
325         * 
326         * @return Returns the organizationInventoryName
327         */
328        public String getOrganizationInventoryName() {
329            return organizationInventoryName;
330        }
331    
332        /**
333         * Gets the organizationOwnerAccount attribute.
334         * 
335         * @return Returns the organizationOwnerAccount
336         */
337        public Account getOrganizationOwnerAccount() {
338            return organizationOwnerAccount;
339        }
340    
341        /**
342         * Gets the oldOrganizationOwnerAccount attribute.
343         * 
344         * @return Returns the oldOrganizationOwnerAccount
345         */
346        public Account getOldOrganizationOwnerAccount() {
347            return oldOrganizationOwnerAccount;
348        }
349    
350        /**
351         * Gets the organizationOwnerAccountNumber attribute.
352         * 
353         * @return Returns the organizationOwnerAccountNumber
354         */
355        public String getOrganizationOwnerAccountNumber() {
356            return organizationOwnerAccountNumber;
357        }
358    
359        /**
360         * Gets the organizationOwnerChartOfAccounts attribute.
361         * 
362         * @return Returns the organizationOwnerChartOfAccounts
363         */
364        public Chart getOrganizationOwnerChartOfAccounts() {
365            return organizationOwnerChartOfAccounts;
366        }
367    
368    
369        /**
370         * Gets the organizationOwnerChartOfAccountsCode attribute.
371         * 
372         * @return Returns the organizationOwnerChartOfAccountsCode
373         */
374        public String getOrganizationOwnerChartOfAccountsCode() {
375            return organizationOwnerChartOfAccountsCode;
376        }
377    
378        /**
379         * Gets the organizationTagNumber attribute.
380         * 
381         * @return Returns the organizationTagNumber
382         */
383        public String getOrganizationTagNumber() {
384            return organizationTagNumber;
385        }
386    
387        /**
388         * Gets the organizationText attribute.
389         * 
390         * @return Returns the organizationText
391         */
392        public String getOrganizationText() {
393            return organizationText;
394        }
395    
396        /**
397         * Gets the representativeUniversalIdentifier attribute.
398         * 
399         * @return Returns the representativeUniversalIdentifier
400         */
401        public String getRepresentativeUniversalIdentifier() {
402            return representativeUniversalIdentifier;
403        }
404    
405        /**
406         * Gets the transferOfFundsFinancialDocument attribute.
407         * 
408         * @return Returns the transferOfFundsFinancialDocument.
409         */
410        public TransferOfFundsDocument getTransferOfFundsFinancialDocument() {
411            if (StringUtils.isNotBlank(getTransferOfFundsFinancialDocumentNumber())) {
412                Map<String, String> primaryKeys = new HashMap<String, String>();
413                primaryKeys.put(KFSPropertyConstants.DOCUMENT_NUMBER, getTransferOfFundsFinancialDocumentNumber());
414                PersistableBusinessObject obj = SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(TransferOfFundsDocument.class, primaryKeys);
415                if (ObjectUtils.isNotNull(obj)) {
416                    return (TransferOfFundsDocument) obj;
417                }
418            }
419            return null;
420        }
421    
422        /**
423         * Gets the transferOfFundsFinancialDocumentNumber attribute.
424         * 
425         * @return Returns the transferOfFundsFinancialDocumentNumber
426         */
427        public String getTransferOfFundsFinancialDocumentNumber() {
428            return transferOfFundsFinancialDocumentNumber;
429        }
430    
431        /**
432         * Gets the capitalAssetNumber attribute.
433         * 
434         * @return Returns the capitalAssetNumber.
435         */
436        public Long getCapitalAssetNumber() {
437            return capitalAssetNumber;
438        }
439    
440        /**
441         * Sets the capitalAssetNumber attribute value.
442         * 
443         * @param capitalAssetNumber The capitalAssetNumber to set.
444         */
445        public void setCapitalAssetNumber(Long capitalAssetNumber) {
446            this.capitalAssetNumber = capitalAssetNumber;
447        }
448    
449        /**
450         * @see org.kuali.rice.kns.document.DocumentBase#postProcessSave(org.kuali.rice.kns.rule.event.KualiDocumentEvent)
451         */
452        @Override
453        public void postProcessSave(KualiDocumentEvent event) {
454            super.postProcessSave(event);
455    
456            if (!(event instanceof SaveDocumentEvent)) { // don't lock until they route
457                ArrayList capitalAssetNumbers = new ArrayList<Long>();
458                if (this.getCapitalAssetNumber() != null) {
459                    capitalAssetNumbers.add(this.getCapitalAssetNumber());
460                }
461    
462                if (!this.getCapitalAssetManagementModuleService().storeAssetLocks(capitalAssetNumbers, this.getDocumentNumber(), CamsConstants.DocumentTypeName.ASSET_TRANSFER, null)) {
463                    throw new ValidationException("Asset " + capitalAssetNumbers.toString() + " is being locked by other documents.");
464                }
465            }
466        }
467    
468        protected CapitalAssetManagementModuleService getCapitalAssetManagementModuleService() {
469            return SpringContext.getBean(CapitalAssetManagementModuleService.class);
470        }
471    
472        /**
473         * @see org.kuali.kfs.sys.document.GeneralLedgerPostingDocumentBase#doRouteStatusChange()
474         */
475        @Override
476        public void doRouteStatusChange(DocumentRouteStatusChangeDTO statusChangeEvent) {
477            super.doRouteStatusChange(statusChangeEvent);
478    
479            KualiWorkflowDocument workflowDocument = getDocumentHeader().getWorkflowDocument();
480            if (workflowDocument.stateIsProcessed()) {
481                SpringContext.getBean(AssetTransferService.class).saveApprovedChanges(this);
482            }
483    
484            // Remove asset lock when doc status change. We don't include stateIsFinal since document always go to 'processed' first.
485            if (workflowDocument.stateIsCanceled() || workflowDocument.stateIsDisapproved() || workflowDocument.stateIsProcessed()) {
486                getCapitalAssetManagementModuleService().deleteAssetLocks(this.getDocumentNumber(), null);
487            }
488        }
489    
490        public boolean isDebit(GeneralLedgerPendingEntrySourceDetail postable) {
491            AssetGlpeSourceDetail srcDetail = (AssetGlpeSourceDetail) postable;
492            boolean isDebit = false;
493            // For source account, debit line when capitalization amount is negative or accumulated depreciation is positive or offset
494            // amount is positive
495            if (srcDetail.isSource()) {
496                if ((srcDetail.isCapitalization() && srcDetail.getAmount().isNegative()) || (srcDetail.isAccumulatedDepreciation() && srcDetail.getAmount().isPositive()) || (srcDetail.isCapitalizationOffset() && srcDetail.getAmount().isPositive())) {
497                    isDebit = true;
498                }
499            }
500            // For target account, debit line when capitalization is positive or accumulated depreciation is negative or offset amount
501            // is negative
502            if (!srcDetail.isSource()) {
503                if ((srcDetail.isCapitalization() && srcDetail.getAmount().isPositive()) || (srcDetail.isAccumulatedDepreciation() && srcDetail.getAmount().isNegative()) || (srcDetail.isCapitalizationOffset() && srcDetail.getAmount().isNegative())) {
504                    isDebit = true;
505                }
506            }
507            return isDebit;
508    
509        }
510    
511    
512        /**
513         * Gets the interdepartmentalSalesIndicator attribute.
514         * 
515         * @return Returns the interdepartmentalSalesIndicator
516         */
517        public boolean isInterdepartmentalSalesIndicator() {
518            return interdepartmentalSalesIndicator;
519        }
520    
521    
522        public void setAsset(Asset asset) {
523            this.asset = asset;
524        }
525    
526        /**
527         * Sets the building attribute value.
528         * 
529         * @param building The building to set.
530         * @deprecated
531         */
532        public void setBuilding(Building building) {
533            this.building = building;
534        }
535    
536    
537        /**
538         * Sets the buildingCode attribute.
539         * 
540         * @param buildingCode The buildingCode to set.
541         */
542        public void setBuildingCode(String buildingCode) {
543            this.buildingCode = buildingCode;
544        }
545    
546    
547        /**
548         * Sets the buildingRoom attribute value.
549         * 
550         * @param buildingRoom The buildingRoom to set.
551         * @deprecated
552         */
553        public void setBuildingRoom(Room buildingRoom) {
554            this.buildingRoom = buildingRoom;
555        }
556    
557        /**
558         * Sets the buildingRoomNumber attribute.
559         * 
560         * @param buildingRoomNumber The buildingRoomNumber to set.
561         */
562        public void setBuildingRoomNumber(String buildingRoomNumber) {
563            this.buildingRoomNumber = buildingRoomNumber;
564        }
565    
566    
567        /**
568         * Sets the buildingSubRoomNumber attribute.
569         * 
570         * @param buildingSubRoomNumber The buildingSubRoomNumber to set.
571         */
572        public void setBuildingSubRoomNumber(String buildingSubRoomNumber) {
573            this.buildingSubRoomNumber = buildingSubRoomNumber;
574        }
575    
576    
577        /**
578         * Sets the campus attribute.
579         * 
580         * @param campus The campus to set.
581         * @deprecated
582         */
583        public void setCampus(Campus campus) {
584            this.campus = campus;
585        }
586    
587    
588        /**
589         * Sets the campusCode attribute.
590         * 
591         * @param campusCode The campusCode to set.
592         */
593        public void setCampusCode(String campusCode) {
594            this.campusCode = campusCode;
595        }
596    
597        /**
598         * Sets the documentNumber attribute.
599         * 
600         * @param documentNumber The documentNumber to set.
601         */
602        public void setDocumentNumber(String documentNumber) {
603            this.documentNumber = documentNumber;
604        }
605    
606    
607        public void setGeneralLedgerPostables(List<AssetGlpeSourceDetail> generalLedgerPostables) {
608            this.sourceAssetGlpeSourceDetails = generalLedgerPostables;
609        }
610    
611    
612        /**
613         * Sets the interdepartmentalSalesIndicator attribute.
614         * 
615         * @param interdepartmentalSalesIndicator The interdepartmentalSalesIndicator to set.
616         */
617        public void setInterdepartmentalSalesIndicator(boolean interdepartmentalSalesIndicator) {
618            this.interdepartmentalSalesIndicator = interdepartmentalSalesIndicator;
619        }
620    
621    
622        /**
623         * Sets the offCampusAddress attribute.
624         * 
625         * @param offCampusAddress The offCampusAddress to set.
626         */
627        public void setOffCampusAddress(String offCampusAddress) {
628            this.offCampusAddress = offCampusAddress;
629        }
630    
631        /**
632         * Sets the offCampusCityName attribute.
633         * 
634         * @param offCampusCityName The offCampusCityName to set.
635         */
636        public void setOffCampusCityName(String offCampusCityName) {
637            this.offCampusCityName = offCampusCityName;
638        }
639    
640        /**
641         * Sets the offCampusState attribute value.
642         * 
643         * @param offCampusState The offCampusState to set.
644         * @deprecated
645         */
646        public void setOffCampusState(State offCampusState) {
647            this.offCampusState = offCampusState;
648        }
649    
650    
651        /**
652         * Sets the offCampusStateCode attribute.
653         * 
654         * @param offCampusStateCode The offCampusStateCode to set.
655         */
656        public void setOffCampusStateCode(String offCampusStateCode) {
657            this.offCampusStateCode = offCampusStateCode;
658        }
659    
660    
661        /**
662         * Sets the offCampusZipCode attribute.
663         * 
664         * @param offCampusZipCode The offCampusZipCode to set.
665         */
666        public void setOffCampusZipCode(String offCampusZipCode) {
667            this.offCampusZipCode = offCampusZipCode;
668        }
669    
670        /**
671         * Sets the postalZipCode attribute.
672         * 
673         * @param postalZipCode The postalZipCode to set.
674         */
675        public void setPostalZipCode(PostalCode postalZipCode) {
676            this.postalZipCode = postalZipCode;
677        }
678    
679        /**
680         * Sets the offCampusCountry attribute value.
681         * 
682         * @param offCampusCountry The offCampusCountry to set.
683         * @deprecated
684         */
685        public void setOffCampusCountry(Country offCampusCountry) {
686            this.offCampusCountry = offCampusCountry;
687        }
688    
689    
690        /**
691         * Sets the organizationInventoryName attribute.
692         * 
693         * @param organizationInventoryName The organizationInventoryName to set.
694         */
695        public void setOrganizationInventoryName(String organizationInventoryName) {
696            this.organizationInventoryName = organizationInventoryName;
697        }
698    
699    
700        /**
701         * Sets the organizationOwnerAccount attribute.
702         * 
703         * @param organizationOwnerAccount The organizationOwnerAccount to set.
704         * @deprecated
705         */
706        public void setOrganizationOwnerAccount(Account organizationOwnerAccount) {
707            this.organizationOwnerAccount = organizationOwnerAccount;
708        }
709    
710        /**
711         * Sets the oldOrganizationOwnerAccount attribute.
712         * 
713         * @param oldOrganizationOwnerAccount The oldOrganizationOwnerAccount to set.
714         * @deprecated
715         */
716        public void setOldOrganizationOwnerAccount(Account oldOrganizationOwnerAccount) {
717            this.oldOrganizationOwnerAccount = oldOrganizationOwnerAccount;
718        }
719    
720        /**
721         * Sets the organizationOwnerAccountNumber attribute.
722         * 
723         * @param organizationOwnerAccountNumber The organizationOwnerAccountNumber to set.
724         */
725        public void setOrganizationOwnerAccountNumber(String organizationOwnerAccountNumber) {
726            this.organizationOwnerAccountNumber = organizationOwnerAccountNumber;
727        }
728    
729    
730        /**
731         * Sets the organizationOwnerChartOfAccounts attribute.
732         * 
733         * @param organizationOwnerChartOfAccounts The organizationOwnerChartOfAccounts to set.
734         * @deprecated
735         */
736        public void setOrganizationOwnerChartOfAccounts(Chart organizationOwnerChartOfAccounts) {
737            this.organizationOwnerChartOfAccounts = organizationOwnerChartOfAccounts;
738        }
739    
740    
741        /**
742         * Sets the organizationOwnerChartOfAccountsCode attribute.
743         * 
744         * @param organizationOwnerChartOfAccountsCode The organizationOwnerChartOfAccountsCode to set.
745         */
746        public void setOrganizationOwnerChartOfAccountsCode(String organizationOwnerChartOfAccountsCode) {
747            this.organizationOwnerChartOfAccountsCode = organizationOwnerChartOfAccountsCode;
748        }
749    
750        /**
751         * Sets the organizationTagNumber attribute.
752         * 
753         * @param organizationTagNumber The organizationTagNumber to set.
754         */
755        public void setOrganizationTagNumber(String organizationTagNumber) {
756            this.organizationTagNumber = organizationTagNumber;
757        }
758    
759    
760        /**
761         * Sets the organizationText attribute.
762         * 
763         * @param organizationText The organizationText to set.
764         */
765        public void setOrganizationText(String organizationText) {
766            this.organizationText = organizationText;
767        }
768    
769    
770        /**
771         * Sets the representativeUniversalIdentifier attribute.
772         * 
773         * @param representativeUniversalIdentifier The representativeUniversalIdentifier to set.
774         */
775        public void setRepresentativeUniversalIdentifier(String representativeUniversalIdentifier) {
776            this.representativeUniversalIdentifier = representativeUniversalIdentifier;
777        }
778    
779    
780        /**
781         * Sets the transferOfFundsFinancialDocumentNumber attribute.
782         * 
783         * @param transferOfFundsFinancialDocumentNumber The transferOfFundsFinancialDocumentNumber to set.
784         */
785        public void setTransferOfFundsFinancialDocumentNumber(String transferOfFundsFinancialDocumentNumber) {
786            this.transferOfFundsFinancialDocumentNumber = transferOfFundsFinancialDocumentNumber;
787        }
788    
789    
790        /**
791         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
792         */
793        protected LinkedHashMap<String, String> toStringMapper() {
794            LinkedHashMap<String, String> m = new LinkedHashMap<String, String>();
795            m.put("documentNumber", this.documentNumber);
796            return m;
797        }
798    
799        /**
800         * @see org.kuali.kfs.sys.document.GeneralLedgerPendingEntrySource#getGeneralLedgerPostables()
801         */
802        public List<GeneralLedgerPendingEntrySourceDetail> getGeneralLedgerPendingEntrySourceDetails() {
803            List<GeneralLedgerPendingEntrySourceDetail> generalLedgerPostables = new ArrayList<GeneralLedgerPendingEntrySourceDetail>();
804            generalLedgerPostables.addAll(this.sourceAssetGlpeSourceDetails);
805            generalLedgerPostables.addAll(this.targetAssetGlpeSourceDetails);
806            return generalLedgerPostables;
807        }
808    
809    
810        public List<AssetGlpeSourceDetail> getTargetAssetGlpeSourceDetails() {
811            if (this.targetAssetGlpeSourceDetails == null) {
812                this.targetAssetGlpeSourceDetails = new ArrayList<AssetGlpeSourceDetail>();
813            }
814            return this.targetAssetGlpeSourceDetails;
815        }
816    
817    
818        public void setTargetAssetGlpeSourceDetails(List<AssetGlpeSourceDetail> targetAssetGlpeSourceDetails) {
819            this.targetAssetGlpeSourceDetails = targetAssetGlpeSourceDetails;
820        }
821    
822    
823        public void setSourceAssetGlpeSourceDetails(List<AssetGlpeSourceDetail> sourceAssetGlpeSourceDetails) {
824            this.sourceAssetGlpeSourceDetails = sourceAssetGlpeSourceDetails;
825        }
826    
827        public List<GeneralLedgerPendingEntrySourceDetail> getGeneralLedgerPostables() {
828            List<GeneralLedgerPendingEntrySourceDetail> generalLedgerPostables = new ArrayList<GeneralLedgerPendingEntrySourceDetail>();
829            generalLedgerPostables.addAll(this.sourceAssetGlpeSourceDetails);
830            generalLedgerPostables.addAll(this.targetAssetGlpeSourceDetails);
831            return generalLedgerPostables;
832        }
833    
834    
835        public String getOffCampusCountryCode() {
836            return offCampusCountryCode;
837        }
838    
839    
840        public void setOffCampusCountryCode(String offCampusCountryCode) {
841            this.offCampusCountryCode = offCampusCountryCode;
842        }
843    
844    
845        public String getOffCampusName() {
846            return offCampusName;
847        }
848    
849    
850        public void setOffCampusName(String offCampusName) {
851            this.offCampusName = offCampusName;
852        }
853    
854    
855        public String getOldOrganizationOwnerAccountNumber() {
856            return oldOrganizationOwnerAccountNumber;
857        }
858    
859    
860        public void setOldOrganizationOwnerAccountNumber(String oldOrganizationOwnerAccountNumber) {
861            this.oldOrganizationOwnerAccountNumber = oldOrganizationOwnerAccountNumber;
862        }
863    
864    
865        public String getOldOrganizationOwnerChartOfAccountsCode() {
866            return oldOrganizationOwnerChartOfAccountsCode;
867        }
868    
869    
870        public void setOldOrganizationOwnerChartOfAccountsCode(String oldOrganizationOwnerChartOfAccountsCode) {
871            this.oldOrganizationOwnerChartOfAccountsCode = oldOrganizationOwnerChartOfAccountsCode;
872        }
873    
874        public void clearGlPostables() {
875            getGeneralLedgerPendingEntries().clear();
876            getSourceAssetGlpeSourceDetails().clear();
877            getTargetAssetGlpeSourceDetails().clear();
878        }
879    
880        public String getHiddenFieldForError() {
881            return hiddenFieldForError;
882        }
883    
884    
885        public void setHiddenFieldForError(String hiddenFieldForError) {
886            this.hiddenFieldForError = hiddenFieldForError;
887        }
888    
889    
890    }