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.endow.businessobject;
017    
018    import java.math.BigDecimal;
019    import java.sql.Date;
020    import java.util.LinkedHashMap;
021    
022    import org.kuali.kfs.module.endow.EndowConstants;
023    import org.kuali.kfs.module.endow.EndowPropertyConstants;
024    import org.kuali.kfs.module.endow.document.service.KEMService;
025    import org.kuali.kfs.sys.context.SpringContext;
026    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
027    
028    public class KEMIDCurrentBalanceDetail extends PersistableBusinessObjectBase {
029    
030        private String kemid;
031        private String incomePrincipalIndicator;
032        private String reportingGroupCode;
033        private BigDecimal valueAtMarket;
034        private BigDecimal annualEstimatedIncome;
035        private BigDecimal remainderOfFYEstimatedIncome;
036        private BigDecimal nextFYEstimatedIncome;
037    
038        // not persisted; used to tell whether there will be a drill down on value at market
039        private boolean noDrillDownOnMarketVal;
040    
041        private KEMID kemidObj;
042        private SecurityReportingGroup reportingGroup;
043        private IncomePrincipalIndicator ipIndicator;
044    
045        /**
046         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
047         */
048        @Override
049        protected LinkedHashMap toStringMapper() {
050            LinkedHashMap m = new LinkedHashMap();
051            m.put(EndowPropertyConstants.KEMID, this.kemid);
052            return m;
053        }
054    
055    
056        /**
057         * Gets the ipIndicator
058         * 
059         * @return ipIndicator
060         */
061        public IncomePrincipalIndicator getIpIndicator() {
062            return ipIndicator;
063        }
064    
065    
066        /**
067         * Sets the ipIndicator
068         * 
069         * @param ipIndicator
070         */
071        public void setIpIndicator(IncomePrincipalIndicator ipIndicator) {
072            this.ipIndicator = ipIndicator;
073        }
074    
075    
076        /**
077         * Gets the kemidObj.
078         * 
079         * @return kemidObj
080         */
081        public KEMID getKemidObj() {
082            return kemidObj;
083        }
084    
085    
086        /**
087         * Sets the kemidObj.
088         * 
089         * @param kemidObj
090         */
091        public void setKemidObj(KEMID kemidObj) {
092            this.kemidObj = kemidObj;
093        }
094    
095    
096        /**
097         * Gets the annualEstimatedIncome.
098         * 
099         * @return annualEstimatedIncome
100         */
101        public BigDecimal getAnnualEstimatedIncome() {
102            return annualEstimatedIncome;
103        }
104    
105    
106        /**
107         * Sets the annualEstimatedIncome.
108         * 
109         * @param annualEstimatedIncome
110         */
111        public void setAnnualEstimatedIncome(BigDecimal annualEstimatedIncome) {
112            this.annualEstimatedIncome = annualEstimatedIncome;
113        }
114    
115    
116        /**
117         * Gets the incomePrincipalIndicator.
118         * 
119         * @return incomePrincipalIndicator
120         */
121        public String getIncomePrincipalIndicator() {
122            return incomePrincipalIndicator;
123        }
124    
125    
126        /**
127         * Sets the incomePrincipalIndicator.
128         * 
129         * @param incomePrincipalIndicator
130         */
131        public void setIncomePrincipalIndicator(String incomePrincipalIndicator) {
132            this.incomePrincipalIndicator = incomePrincipalIndicator;
133        }
134    
135    
136        /**
137         * Gets the nextFYEstimatedIncome.
138         * 
139         * @return nextFYEstimatedIncome
140         */
141        public BigDecimal getNextFYEstimatedIncome() {
142            return nextFYEstimatedIncome;
143        }
144    
145    
146        /**
147         * Sets the nextFYEstimatedIncome.
148         * 
149         * @param nextFYEstimatedIncome
150         */
151        public void setNextFYEstimatedIncome(BigDecimal nextFYEstimatedIncome) {
152            this.nextFYEstimatedIncome = nextFYEstimatedIncome;
153        }
154    
155    
156        /**
157         * Gets the remainderOfFYEstimatedIncome.
158         * 
159         * @return remainderOfFYEstimatedIncome
160         */
161        public BigDecimal getRemainderOfFYEstimatedIncome() {
162            return remainderOfFYEstimatedIncome;
163        }
164    
165    
166        /**
167         * Sets the remainderOfFYEstimatedIncome.
168         * 
169         * @param remainderOfFYEstimatedIncome
170         */
171        public void setRemainderOfFYEstimatedIncome(BigDecimal remainderOfFYEstimatedIncome) {
172            this.remainderOfFYEstimatedIncome = remainderOfFYEstimatedIncome;
173        }
174    
175    
176        /**
177         * Gets the reportingGroupCode.
178         * 
179         * @return reportingGroupCode
180         */
181        public String getReportingGroupCode() {
182            return reportingGroupCode;
183        }
184    
185    
186        /**
187         * Sets the reportingGroupCode.
188         * 
189         * @param reportingGroupCode
190         */
191        public void setReportingGroupCode(String reportingGroupCode) {
192            this.reportingGroupCode = reportingGroupCode;
193        }
194    
195    
196        /**
197         * Gets the valueAtMarket.
198         * 
199         * @return valueAtMarket
200         */
201        public BigDecimal getValueAtMarket() {
202            return valueAtMarket;
203        }
204    
205    
206        /**
207         * Sets the valueAtMarket.
208         * 
209         * @param valueAtMarket
210         */
211        public void setValueAtMarket(BigDecimal valueAtMarket) {
212            this.valueAtMarket = valueAtMarket;
213        }
214    
215        /**
216         * Gets the incomeAtMarket. If income principal indicator is 'I' then the valueAtMarket represents the incomeAtMarket. Otherwise
217         * the incomeAtMarket will be zero.
218         * 
219         * @return incomeAtMarket
220         */
221        public BigDecimal getIncomeAtMarket() {
222            BigDecimal incomeAtMarket = BigDecimal.ZERO.setScale(2);
223            if (EndowConstants.IncomePrincipalIndicator.INCOME.equalsIgnoreCase(incomePrincipalIndicator)) {
224                incomeAtMarket = valueAtMarket;
225            }
226            return incomeAtMarket;
227        }
228    
229        /**
230         * Gets the principalAtMarket. If income principal indicator is 'P' then the valueAtMarket represents the principalAtMarket.
231         * Otherwise the principalAtMarket will be zero.
232         * 
233         * @return
234         */
235        public BigDecimal getPrincipalAtMarket() {
236            BigDecimal principalAtMarket = BigDecimal.ZERO.setScale(2);
237            if (EndowConstants.IncomePrincipalIndicator.PRINCIPAL.equalsIgnoreCase(incomePrincipalIndicator)) {
238                principalAtMarket = valueAtMarket;
239            }
240            return principalAtMarket;
241        }
242    
243    
244        /**
245         * Gets the kemid.
246         * 
247         * @return kemid
248         */
249        public String getKemid() {
250            return kemid;
251        }
252    
253    
254        /**
255         * Sets the kemid.
256         * 
257         * @param kemid
258         */
259        public void setKemid(String kemid) {
260            this.kemid = kemid;
261        }
262    
263        /**
264         * Gets the Balance Date which is the Current System Process date
265         * 
266         * @return the Balance Date
267         */
268        public Date getBalanceDate() {
269    
270            return SpringContext.getBean(KEMService.class).getCurrentDate();
271        }
272    
273    
274        /**
275         * Gets the reportingGroup.
276         * 
277         * @return reportingGroup
278         */
279        public SecurityReportingGroup getReportingGroup() {
280            return reportingGroup;
281        }
282    
283    
284        /**
285         * Sets the reportingGroup.
286         * 
287         * @param reportingGroup
288         */
289        public void setReportingGroup(SecurityReportingGroup reportingGroup) {
290            this.reportingGroup = reportingGroup;
291        }
292    
293    
294        /**
295         * Gets the noDrillDownOnMarketVal.
296         * 
297         * @return noDrillDownOnMarketVal
298         */
299        public boolean isNoDrillDownOnMarketVal() {
300            return noDrillDownOnMarketVal;
301        }
302    
303    
304        /**
305         * Sets the noDrillDownOnMarketVal.
306         * 
307         * @param noDrillDownOnMarketVal
308         */
309        public void setNoDrillDownOnMarketVal(boolean noDrillDownOnMarketVal) {
310            this.noDrillDownOnMarketVal = noDrillDownOnMarketVal;
311        }
312    
313    }