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    
017    package org.kuali.kfs.fp.businessobject;
018    
019    import java.util.LinkedHashMap;
020    
021    import org.kuali.kfs.sys.KFSConstants;
022    import org.kuali.kfs.sys.KFSPropertyConstants;
023    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
024    import org.kuali.rice.kns.util.KualiDecimal;
025    
026    /**
027     * Represents a breakdown of currency amounts (i.e. $100, $50, $20, etc.)
028     */
029    public class CurrencyDetail extends PersistableBusinessObjectBase {
030    
031        private String documentNumber;
032        private String financialDocumentTypeCode;
033        private String cashieringRecordSource;
034        private KualiDecimal financialDocumentHundredDollarAmount;
035        private KualiDecimal financialDocumentFiftyDollarAmount;
036        private KualiDecimal financialDocumentTwentyDollarAmount;
037        private KualiDecimal financialDocumentTenDollarAmount;
038        private KualiDecimal financialDocumentFiveDollarAmount;
039        private KualiDecimal financialDocumentTwoDollarAmount;
040        private KualiDecimal financialDocumentOneDollarAmount;
041        private KualiDecimal financialDocumentOtherDollarAmount;
042    
043        /**
044         * Default constructor.
045         */
046        public CurrencyDetail() {
047    
048        }
049    
050        /**
051         * Gets the documentNumber attribute.
052         * 
053         * @return Returns the documentNumber
054         */
055        public String getDocumentNumber() {
056            return documentNumber;
057        }
058    
059        /**
060         * Sets the documentNumber attribute.
061         * 
062         * @param documentNumber The documentNumber to set.
063         */
064        public void setDocumentNumber(String documentNumber) {
065            this.documentNumber = documentNumber;
066        }
067    
068    
069        /**
070         * Gets the financialDocumentTypeCode attribute.
071         * 
072         * @return Returns the financialDocumentTypeCode
073         */
074        public String getFinancialDocumentTypeCode() {
075            return financialDocumentTypeCode;
076        }
077    
078        /**
079         * Sets the financialDocumentTypeCode attribute.
080         * 
081         * @param financialDocumentTypeCode The financialDocumentTypeCode to set.
082         */
083        public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
084            this.financialDocumentTypeCode = financialDocumentTypeCode;
085        }
086    
087    
088        /**
089         * Gets the cashieringRecordSource attribute.
090         * 
091         * @return Returns the cashieringRecordSource
092         */
093        public String getCashieringRecordSource() {
094            return cashieringRecordSource;
095        }
096    
097        /**
098         * Sets the cashieringRecordSource attribute.
099         * 
100         * @param cashieringRecordSource The cashieringRecordSource to set.
101         */
102        public void setCashieringRecordSource(String financialDocumentColumnTypeCode) {
103            this.cashieringRecordSource = financialDocumentColumnTypeCode;
104        }
105    
106    
107        /**
108         * Gets the financialDocumentHundredDollarAmount attribute.
109         * 
110         * @return Returns the financialDocumentHundredDollarAmount
111         */
112        public KualiDecimal getFinancialDocumentHundredDollarAmount() {
113            return financialDocumentHundredDollarAmount;
114        }
115    
116        /**
117         * Sets the financialDocumentHundredDollarAmount attribute.
118         * 
119         * @param financialDocumentHundredDollarAmount The financialDocumentHundredDollarAmount to set.
120         */
121        public void setFinancialDocumentHundredDollarAmount(KualiDecimal financialDocumentHundredDollarAmount) {
122            this.financialDocumentHundredDollarAmount = financialDocumentHundredDollarAmount;
123        }
124    
125        /**
126         * Returns the actual count of hundred dollar bills
127         * 
128         * @return the number of hundred dollar bills present in the drawer
129         */
130        public Integer getHundredDollarCount() {
131            return (financialDocumentHundredDollarAmount == null) ? new Integer(0) : new Integer(financialDocumentHundredDollarAmount.divide(KFSConstants.CurrencyTypeAmounts.HUNDRED_DOLLAR_AMOUNT).intValue());
132        }
133    
134        /**
135         * This sets the count of hundred dollar bills present in the drawer
136         * 
137         * @param count the number of hundred dollar bills present in the drawer
138         */
139        public void setHundredDollarCount(Integer count) {
140            if (count != null) {
141                this.financialDocumentHundredDollarAmount = new KualiDecimal(count.intValue()).multiply(KFSConstants.CurrencyTypeAmounts.HUNDRED_DOLLAR_AMOUNT);
142            }
143        }
144    
145        /**
146         * Gets the financialDocumentFiftyDollarAmount attribute.
147         * 
148         * @return Returns the financialDocumentFiftyDollarAmount
149         */
150        public KualiDecimal getFinancialDocumentFiftyDollarAmount() {
151            return financialDocumentFiftyDollarAmount;
152        }
153    
154        /**
155         * Sets the financialDocumentFiftyDollarAmount attribute.
156         * 
157         * @param financialDocumentFiftyDollarAmount The financialDocumentFiftyDollarAmount to set.
158         */
159        public void setFinancialDocumentFiftyDollarAmount(KualiDecimal financialDocumentFiftyDollarAmount) {
160            this.financialDocumentFiftyDollarAmount = financialDocumentFiftyDollarAmount;
161        }
162    
163        /**
164         * Returns the actual count of fifty dollar bills
165         * 
166         * @return the number of fifty dollar bills present in the drawer
167         */
168        public Integer getFiftyDollarCount() {
169            return (financialDocumentFiftyDollarAmount == null) ? new Integer(0) : new Integer(financialDocumentFiftyDollarAmount.divide(KFSConstants.CurrencyTypeAmounts.FIFTY_DOLLAR_AMOUNT).intValue());
170        }
171    
172        /**
173         * This sets the count of hundred dollar bills present in the drawer
174         * 
175         * @param count the number of hundred dollar bills present in the drawer
176         */
177        public void setFiftyDollarCount(Integer count) {
178            if (count != null) {
179                this.financialDocumentFiftyDollarAmount = new KualiDecimal(count.intValue()).multiply(KFSConstants.CurrencyTypeAmounts.FIFTY_DOLLAR_AMOUNT);
180            }
181        }
182    
183        /**
184         * Gets the financialDocumentTwentyDollarAmount attribute.
185         * 
186         * @return Returns the financialDocumentTwentyDollarAmount
187         */
188        public KualiDecimal getFinancialDocumentTwentyDollarAmount() {
189            return financialDocumentTwentyDollarAmount;
190        }
191    
192        /**
193         * Sets the financialDocumentTwentyDollarAmount attribute.
194         * 
195         * @param financialDocumentTwentyDollarAmount The financialDocumentTwentyDollarAmount to set.
196         */
197        public void setFinancialDocumentTwentyDollarAmount(KualiDecimal financialDocumentTwentyDollarAmount) {
198            this.financialDocumentTwentyDollarAmount = financialDocumentTwentyDollarAmount;
199        }
200    
201        /**
202         * Returns the actual count of twenty dollar bills
203         * 
204         * @return the number of twenty dollar bills present in the drawer
205         */
206        public Integer getTwentyDollarCount() {
207            return (financialDocumentTwentyDollarAmount == null) ? new Integer(0) : new Integer(financialDocumentTwentyDollarAmount.divide(KFSConstants.CurrencyTypeAmounts.TWENTY_DOLLAR_AMOUNT).intValue());
208        }
209    
210        /**
211         * This sets the count of twenty dollar bills present in the drawer
212         * 
213         * @param count the number of twenty dollar bills present in the drawer
214         */
215        public void setTwentyDollarCount(Integer count) {
216            if (count != null) {
217                this.financialDocumentTwentyDollarAmount = new KualiDecimal(count.intValue()).multiply(KFSConstants.CurrencyTypeAmounts.TWENTY_DOLLAR_AMOUNT);
218            }
219        }
220    
221        /**
222         * Gets the financialDocumentTenDollarAmount attribute.
223         * 
224         * @return Returns the financialDocumentTenDollarAmount
225         */
226        public KualiDecimal getFinancialDocumentTenDollarAmount() {
227            return financialDocumentTenDollarAmount;
228        }
229    
230        /**
231         * Sets the financialDocumentTenDollarAmount attribute.
232         * 
233         * @param financialDocumentTenDollarAmount The financialDocumentTenDollarAmount to set.
234         */
235        public void setFinancialDocumentTenDollarAmount(KualiDecimal financialDocumentTenDollarAmount) {
236            this.financialDocumentTenDollarAmount = financialDocumentTenDollarAmount;
237        }
238    
239        /**
240         * Returns the actual count of ten dollar bills
241         * 
242         * @return the number of ten dollar bills present in the drawer
243         */
244        public Integer getTenDollarCount() {
245            return (financialDocumentTenDollarAmount == null) ? new Integer(0) : new Integer(financialDocumentTenDollarAmount.divide(KFSConstants.CurrencyTypeAmounts.TEN_DOLLAR_AMOUNT).intValue());
246        }
247    
248        /**
249         * This sets the count of ten dollar bills present in the drawer
250         * 
251         * @param count the number of ten dollar bills present in the drawer
252         */
253        public void setTenDollarCount(Integer count) {
254            if (count != null) {
255                this.financialDocumentTenDollarAmount = new KualiDecimal(count.intValue()).multiply(KFSConstants.CurrencyTypeAmounts.TEN_DOLLAR_AMOUNT);
256            }
257        }
258    
259        /**
260         * Gets the financialDocumentFiveDollarAmount attribute.
261         * 
262         * @return Returns the financialDocumentFiveDollarAmount
263         */
264        public KualiDecimal getFinancialDocumentFiveDollarAmount() {
265            return financialDocumentFiveDollarAmount;
266        }
267    
268        /**
269         * Sets the financialDocumentFiveDollarAmount attribute.
270         * 
271         * @param financialDocumentFiveDollarAmount The financialDocumentFiveDollarAmount to set.
272         */
273        public void setFinancialDocumentFiveDollarAmount(KualiDecimal financialDocumentFiveDollarAmount) {
274            this.financialDocumentFiveDollarAmount = financialDocumentFiveDollarAmount;
275        }
276    
277        /**
278         * Returns the actual count of five dollar bills
279         * 
280         * @return the number of five dollar bills present in the drawer
281         */
282        public Integer getFiveDollarCount() {
283            return (financialDocumentFiveDollarAmount == null) ? new Integer(0) : new Integer(financialDocumentFiveDollarAmount.divide(KFSConstants.CurrencyTypeAmounts.FIVE_DOLLAR_AMOUNT).intValue());
284        }
285    
286        /**
287         * This sets the count of five dollar bills present in the drawer
288         * 
289         * @param count the number of five dollar bills present in the drawer
290         */
291        public void setFiveDollarCount(Integer count) {
292            if (count != null) {
293                this.financialDocumentFiveDollarAmount = new KualiDecimal(count.intValue()).multiply(KFSConstants.CurrencyTypeAmounts.FIVE_DOLLAR_AMOUNT);
294            }
295        }
296    
297        /**
298         * Gets the financialDocumentTwoDollarAmount attribute.
299         * 
300         * @return Returns the financialDocumentTwoDollarAmount
301         */
302        public KualiDecimal getFinancialDocumentTwoDollarAmount() {
303            return financialDocumentTwoDollarAmount;
304        }
305    
306        /**
307         * Sets the financialDocumentTwoDollarAmount attribute.
308         * 
309         * @param financialDocumentTwoDollarAmount The financialDocumentTwoDollarAmount to set.
310         */
311        public void setFinancialDocumentTwoDollarAmount(KualiDecimal financialDocumentTwoDollarAmount) {
312            this.financialDocumentTwoDollarAmount = financialDocumentTwoDollarAmount;
313        }
314    
315        /**
316         * Returns the actual count of two dollar bills
317         * 
318         * @return the number of two dollar bills present in the drawer
319         */
320        public Integer getTwoDollarCount() {
321            return (financialDocumentTwoDollarAmount == null) ? new Integer(0) : new Integer(financialDocumentTwoDollarAmount.divide(KFSConstants.CurrencyTypeAmounts.TWO_DOLLAR_AMOUNT).intValue());
322        }
323    
324        /**
325         * This sets the count of two dollar bills present in the drawer
326         * 
327         * @param count the number of two dollar bills present in the drawer
328         */
329        public void setTwoDollarCount(Integer count) {
330            if (count != null) {
331                this.financialDocumentTwoDollarAmount = new KualiDecimal(count.intValue()).multiply(KFSConstants.CurrencyTypeAmounts.TWO_DOLLAR_AMOUNT);
332            }
333        }
334    
335        /**
336         * Gets the financialDocumentOneDollarAmount attribute.
337         * 
338         * @return Returns the financialDocumentOneDollarAmount
339         */
340        public KualiDecimal getFinancialDocumentOneDollarAmount() {
341            return financialDocumentOneDollarAmount;
342        }
343    
344        /**
345         * Sets the financialDocumentOneDollarAmount attribute.
346         * 
347         * @param financialDocumentOneDollarAmount The financialDocumentOneDollarAmount to set.
348         */
349        public void setFinancialDocumentOneDollarAmount(KualiDecimal financialDocumentOneDollarAmount) {
350            this.financialDocumentOneDollarAmount = financialDocumentOneDollarAmount;
351        }
352    
353        /**
354         * Returns the actual count of one dollar bills
355         * 
356         * @return the number of one dollar bills present in the drawer
357         */
358        public Integer getOneDollarCount() {
359            return (financialDocumentOneDollarAmount == null) ? new Integer(0) : new Integer(financialDocumentOneDollarAmount.divide(KFSConstants.CurrencyTypeAmounts.ONE_DOLLAR_AMOUNT).intValue());
360        }
361    
362        /**
363         * This sets the count of one dollar bills present in the drawer
364         * 
365         * @param count the number of one dollar bills present in the drawer
366         */
367        public void setOneDollarCount(Integer count) {
368            if (count != null) {
369                this.financialDocumentOneDollarAmount = new KualiDecimal(count.intValue()).multiply(KFSConstants.CurrencyTypeAmounts.ONE_DOLLAR_AMOUNT);
370            }
371        }
372    
373        /**
374         * Gets the financialDocumentOtherDollarAmount attribute.
375         * 
376         * @return Returns the financialDocumentOtherDollarAmount
377         */
378        public KualiDecimal getFinancialDocumentOtherDollarAmount() {
379            return financialDocumentOtherDollarAmount;
380        }
381    
382        /**
383         * Sets the financialDocumentOtherDollarAmount attribute.
384         * 
385         * @param financialDocumentOtherDollarAmount The financialDocumentOtherDollarAmount to set.
386         */
387        public void setFinancialDocumentOtherDollarAmount(KualiDecimal financialDocumentOtherDollarAmount) {
388            this.financialDocumentOtherDollarAmount = financialDocumentOtherDollarAmount;
389        }
390    
391        /**
392         * This method calculates the total amount represented by all the currency listed in this detail record
393         * 
394         * @return total amount of this detail
395         */
396        public KualiDecimal getTotalAmount() {
397            KualiDecimal result = KualiDecimal.ZERO;
398            if (this.financialDocumentHundredDollarAmount != null) {
399                result = result.add(this.financialDocumentHundredDollarAmount);
400            }
401            if (this.financialDocumentFiftyDollarAmount != null) {
402                result = result.add(this.financialDocumentFiftyDollarAmount);
403            }
404            if (this.financialDocumentTwentyDollarAmount != null) {
405                result = result.add(this.financialDocumentTwentyDollarAmount);
406            }
407            if (this.financialDocumentTenDollarAmount != null) {
408                result = result.add(this.financialDocumentTenDollarAmount);
409            }
410            if (this.financialDocumentFiveDollarAmount != null) {
411                result = result.add(this.financialDocumentFiveDollarAmount);
412            }
413            if (this.financialDocumentTwoDollarAmount != null) {
414                result = result.add(this.financialDocumentTwoDollarAmount);
415            }
416            if (this.financialDocumentOneDollarAmount != null) {
417                result = result.add(this.financialDocumentOneDollarAmount);
418            }
419            if (this.financialDocumentOtherDollarAmount != null) {
420                result = result.add(this.financialDocumentOtherDollarAmount);
421            }
422            return result;
423        }
424    
425        /**
426         * This method sets all the amounts to zero
427         */
428        public void zeroOutAmounts() {
429            this.financialDocumentHundredDollarAmount = KualiDecimal.ZERO;
430            this.financialDocumentFiftyDollarAmount = KualiDecimal.ZERO;
431            this.financialDocumentTwentyDollarAmount = KualiDecimal.ZERO;
432            this.financialDocumentTenDollarAmount = KualiDecimal.ZERO;
433            this.financialDocumentFiveDollarAmount = KualiDecimal.ZERO;
434            this.financialDocumentTwoDollarAmount = KualiDecimal.ZERO;
435            this.financialDocumentOneDollarAmount = KualiDecimal.ZERO;
436            this.financialDocumentOtherDollarAmount = KualiDecimal.ZERO;
437        }
438    
439        /**
440         * This method sets all amounts that are null to zero
441         */
442        public void zeroOutUnpopulatedAmounts() {
443            if (financialDocumentHundredDollarAmount == null) {
444                this.financialDocumentHundredDollarAmount = KualiDecimal.ZERO;
445            }
446            if (financialDocumentFiftyDollarAmount == null) {
447                this.financialDocumentFiftyDollarAmount = KualiDecimal.ZERO;
448            }
449            if (financialDocumentTwentyDollarAmount == null) {
450                this.financialDocumentTwentyDollarAmount = KualiDecimal.ZERO;
451            }
452            if (financialDocumentTenDollarAmount == null) {
453                this.financialDocumentTenDollarAmount = KualiDecimal.ZERO;
454            }
455            if (financialDocumentFiveDollarAmount == null) {
456                this.financialDocumentFiveDollarAmount = KualiDecimal.ZERO;
457            }
458            if (financialDocumentTwoDollarAmount == null) {
459                this.financialDocumentTwoDollarAmount = KualiDecimal.ZERO;
460            }
461            if (financialDocumentOneDollarAmount == null) {
462                this.financialDocumentOneDollarAmount = KualiDecimal.ZERO;
463            }
464            if (financialDocumentOtherDollarAmount == null) {
465                this.financialDocumentOtherDollarAmount = KualiDecimal.ZERO;
466            }
467        }
468    
469        /**
470         * This method adds the amounts from the given currency detail record to this one
471         * 
472         * @param detail the currency detail to add onto this
473         */
474        public void add(CurrencyDetail detail) {
475            if (detail.financialDocumentHundredDollarAmount != null) {
476                if (this.financialDocumentHundredDollarAmount == null) {
477                    this.financialDocumentHundredDollarAmount = KualiDecimal.ZERO.add(detail.financialDocumentHundredDollarAmount);
478                }
479                else {
480                    this.financialDocumentHundredDollarAmount = this.financialDocumentHundredDollarAmount.add(detail.financialDocumentHundredDollarAmount);
481                }
482            }
483            if (detail.financialDocumentFiftyDollarAmount != null) {
484                if (this.financialDocumentFiftyDollarAmount == null) {
485                    this.financialDocumentFiftyDollarAmount = KualiDecimal.ZERO.add(detail.financialDocumentFiftyDollarAmount);
486                }
487                else {
488                    this.financialDocumentFiftyDollarAmount = this.financialDocumentFiftyDollarAmount.add(detail.financialDocumentFiftyDollarAmount);
489                }
490            }
491            if (detail.financialDocumentTwentyDollarAmount != null) {
492                if (this.financialDocumentTwentyDollarAmount == null) {
493                    this.financialDocumentTwentyDollarAmount = KualiDecimal.ZERO.add(detail.financialDocumentTwentyDollarAmount);
494                }
495                else {
496                    this.financialDocumentTwentyDollarAmount = this.financialDocumentTwentyDollarAmount.add(detail.financialDocumentTwentyDollarAmount);
497                }
498            }
499            if (detail.financialDocumentTenDollarAmount != null) {
500                if (this.financialDocumentTenDollarAmount == null) {
501                    this.financialDocumentTenDollarAmount = KualiDecimal.ZERO.add(detail.financialDocumentTenDollarAmount);
502                }
503                else {
504                    this.financialDocumentTenDollarAmount = this.financialDocumentTenDollarAmount.add(detail.financialDocumentTenDollarAmount);
505                }
506            }
507            if (detail.financialDocumentFiveDollarAmount != null) {
508                if (this.financialDocumentFiveDollarAmount == null) {
509                    this.financialDocumentFiveDollarAmount = KualiDecimal.ZERO.add(detail.financialDocumentFiveDollarAmount);
510                }
511                else {
512                    this.financialDocumentFiveDollarAmount = this.financialDocumentFiveDollarAmount.add(detail.financialDocumentFiveDollarAmount);
513                }
514            }
515            if (detail.financialDocumentTwoDollarAmount != null) {
516                if (this.financialDocumentTwoDollarAmount == null) {
517                    this.financialDocumentTwoDollarAmount = KualiDecimal.ZERO.add(detail.financialDocumentTwoDollarAmount);
518                }
519                else {
520                    this.financialDocumentTwoDollarAmount = this.financialDocumentTwoDollarAmount.add(detail.financialDocumentTwoDollarAmount);
521                }
522            }
523            if (detail.financialDocumentOneDollarAmount != null) {
524                if (this.financialDocumentOneDollarAmount == null) {
525                    this.financialDocumentOneDollarAmount = KualiDecimal.ZERO.add(detail.financialDocumentOneDollarAmount);
526                }
527                else {
528                    this.financialDocumentOneDollarAmount = this.financialDocumentOneDollarAmount.add(detail.financialDocumentOneDollarAmount);
529                }
530            }
531            if (detail.financialDocumentOtherDollarAmount != null) {
532                if (this.financialDocumentOtherDollarAmount == null) {
533                    this.financialDocumentOtherDollarAmount = KualiDecimal.ZERO.add(detail.financialDocumentOtherDollarAmount);
534                }
535                else {
536                    this.financialDocumentOtherDollarAmount = this.financialDocumentOtherDollarAmount.add(detail.financialDocumentOtherDollarAmount);
537                }
538            }
539        }
540    
541        /**
542         * This method subtracts the given currency detail from this one
543         * 
544         * @param detail the detail to subtract
545         */
546        public void subtract(CurrencyDetail detail) {
547            if (detail.financialDocumentHundredDollarAmount != null) {
548                if (this.financialDocumentHundredDollarAmount == null) {
549                    this.financialDocumentHundredDollarAmount = KualiDecimal.ZERO.subtract(detail.financialDocumentHundredDollarAmount);
550                }
551                else {
552                    this.financialDocumentHundredDollarAmount = this.financialDocumentHundredDollarAmount.subtract(detail.financialDocumentHundredDollarAmount);
553                }
554            }
555            if (detail.financialDocumentFiftyDollarAmount != null) {
556                if (this.financialDocumentFiftyDollarAmount == null) {
557                    this.financialDocumentFiftyDollarAmount = KualiDecimal.ZERO.subtract(detail.financialDocumentFiftyDollarAmount);
558                }
559                else {
560                    this.financialDocumentFiftyDollarAmount = this.financialDocumentFiftyDollarAmount.subtract(detail.financialDocumentFiftyDollarAmount);
561                }
562            }
563            if (detail.financialDocumentTwentyDollarAmount != null) {
564                if (this.financialDocumentTwentyDollarAmount == null) {
565                    this.financialDocumentTwentyDollarAmount = KualiDecimal.ZERO.subtract(detail.financialDocumentTwentyDollarAmount);
566                }
567                else {
568                    this.financialDocumentTwentyDollarAmount = this.financialDocumentTwentyDollarAmount.subtract(detail.financialDocumentTwentyDollarAmount);
569                }
570            }
571            if (detail.financialDocumentTenDollarAmount != null) {
572                if (this.financialDocumentTenDollarAmount == null) {
573                    this.financialDocumentTenDollarAmount = KualiDecimal.ZERO.subtract(detail.financialDocumentTenDollarAmount);
574                }
575                else {
576                    this.financialDocumentTenDollarAmount = this.financialDocumentTenDollarAmount.subtract(detail.financialDocumentTenDollarAmount);
577                }
578            }
579            if (detail.financialDocumentFiveDollarAmount != null) {
580                if (this.financialDocumentFiveDollarAmount == null) {
581                    this.financialDocumentFiveDollarAmount = KualiDecimal.ZERO.subtract(detail.financialDocumentFiveDollarAmount);
582                }
583                else {
584                    this.financialDocumentFiveDollarAmount = this.financialDocumentFiveDollarAmount.subtract(detail.financialDocumentFiveDollarAmount);
585                }
586            }
587            if (detail.financialDocumentTwoDollarAmount != null) {
588                if (this.financialDocumentTwoDollarAmount == null) {
589                    this.financialDocumentTwoDollarAmount = KualiDecimal.ZERO.subtract(detail.financialDocumentTwoDollarAmount);
590                }
591                else {
592                    this.financialDocumentTwoDollarAmount = this.financialDocumentTwoDollarAmount.subtract(detail.financialDocumentTwoDollarAmount);
593                }
594            }
595            if (detail.financialDocumentOneDollarAmount != null) {
596                if (this.financialDocumentOneDollarAmount == null) {
597                    this.financialDocumentOneDollarAmount = KualiDecimal.ZERO.subtract(detail.financialDocumentOneDollarAmount);
598                }
599                else {
600                    this.financialDocumentOneDollarAmount = this.financialDocumentOneDollarAmount.subtract(detail.financialDocumentOneDollarAmount);
601                }
602            }
603            if (detail.financialDocumentOtherDollarAmount != null) {
604                if (this.financialDocumentOtherDollarAmount == null) {
605                    this.financialDocumentOtherDollarAmount = KualiDecimal.ZERO.subtract(detail.financialDocumentOtherDollarAmount);
606                }
607                else {
608                    this.financialDocumentOtherDollarAmount = this.financialDocumentOtherDollarAmount.subtract(detail.financialDocumentOtherDollarAmount);
609                }
610            }
611        }
612    
613        /**
614         * Does this currency detail actually have any information in it?
615         * 
616         * @return true if any field at all is not null and not zero, false if otherwise
617         */
618        public boolean isEmpty() {
619            return ((this.financialDocumentHundredDollarAmount == null || this.financialDocumentHundredDollarAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentFiftyDollarAmount == null || this.financialDocumentFiftyDollarAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentTwentyDollarAmount == null || this.financialDocumentTwentyDollarAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentTenDollarAmount == null || this.financialDocumentTenDollarAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentFiveDollarAmount == null || this.financialDocumentFiveDollarAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentTwoDollarAmount == null || this.financialDocumentTwoDollarAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentOneDollarAmount == null || this.financialDocumentOneDollarAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentOtherDollarAmount == null || this.financialDocumentOtherDollarAmount.equals(KualiDecimal.ZERO)));
620        }
621    
622        /**
623         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
624         */
625        protected LinkedHashMap toStringMapper() {
626            LinkedHashMap m = new LinkedHashMap();
627            m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
628            m.put("financialDocumentTypeCode", this.financialDocumentTypeCode);
629            m.put("cashieringRecordSource", this.cashieringRecordSource);
630            return m;
631        }
632    }