001    /**
002     * Copyright 2004-2013 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.hr.lm;
017    
018    import java.util.HashMap;
019    import java.util.LinkedHashMap;
020    import java.util.Map;
021    
022    
023    public class LMConstants {
024            public static final String SERVICE_TIME_YEAR = "year";
025            public static final String SERVICE_TIME_MONTHS = "month";
026    
027        public static final class ACCRUAL_EARN_INTERVAL_CODE{
028            public static final String DAILY = "D";
029            public static final String WEEKLY = "W";
030            public static final String SEMI_MONTHLY = "S";
031            public static final String MONTHLY = "M";
032            public static final String YEARLY = "Y";
033            public static final String NO_ACCRUAL = "N";
034            public static final String PAY_CAL = "P";
035        }
036    
037            public static final class ACCRUAL_EARN_INTERVAL{
038                    public static final String DAILY = "daily";
039                    public static final String WEEKLY = "weekly";
040                    public static final String SEMI_MONTHLY = "semimonthly";
041                    public static final String MONTHLY = "monthly";
042                    public static final String YEARLY = "yearly";
043                    public static final String NO_ACCRUAL = "noaccrual";
044                    public static final String PAY_CAL = "paycalendar";
045            }
046            
047            // KPME-1347 Kagata
048            public static final Map<String, String> ACCRUAL_EARN_INTERVAL_MAP = new HashMap<String, String>(7);
049        static {
050            ACCRUAL_EARN_INTERVAL_MAP.put(ACCRUAL_EARN_INTERVAL_CODE.DAILY, "Daily");
051            ACCRUAL_EARN_INTERVAL_MAP.put(ACCRUAL_EARN_INTERVAL_CODE.WEEKLY, "Weekly");
052            ACCRUAL_EARN_INTERVAL_MAP.put(ACCRUAL_EARN_INTERVAL_CODE.SEMI_MONTHLY, "Semi-Monthly");
053            ACCRUAL_EARN_INTERVAL_MAP.put(ACCRUAL_EARN_INTERVAL_CODE.MONTHLY, "Monthly");
054            ACCRUAL_EARN_INTERVAL_MAP.put(ACCRUAL_EARN_INTERVAL_CODE.YEARLY, "Yearly");
055            ACCRUAL_EARN_INTERVAL_MAP.put(ACCRUAL_EARN_INTERVAL_CODE.NO_ACCRUAL, "No Accrual");
056            ACCRUAL_EARN_INTERVAL_MAP.put(ACCRUAL_EARN_INTERVAL_CODE.PAY_CAL, "Pay Calendar");
057        }
058        
059            
060            // Action history
061            public static final class ACTION{
062                    public static final String DELETE = "D";
063                    public static final String ADD = "A";
064                    public static final String MODIFIED = "M";
065            }
066            
067            // Request status
068            public static final class REQUEST_STATUS{
069                    public static final String PLANNED="P";
070                    public static final String REQUESTED="R";
071                    public static final String APPROVED="A";
072                    public static final String DISAPPROVED = "D";
073                    public static final String DEFERRED="F";
074                    public static final String USAGE = "U";
075            }
076            
077             public static final Map<String, String> REQUEST_STATUS_STRINGS = new HashMap<String, String>(6);
078    
079                static {
080                    REQUEST_STATUS_STRINGS.put(REQUEST_STATUS.PLANNED, "Planned");
081                    REQUEST_STATUS_STRINGS.put(REQUEST_STATUS.REQUESTED, "Requested");
082                    REQUEST_STATUS_STRINGS.put(REQUEST_STATUS.APPROVED, "Approved"); 
083                    REQUEST_STATUS_STRINGS.put(REQUEST_STATUS.DISAPPROVED, "Disapproved");
084                    REQUEST_STATUS_STRINGS.put(REQUEST_STATUS.DEFERRED, "Deferred");
085                    REQUEST_STATUS_STRINGS.put(REQUEST_STATUS.USAGE, "Usage");
086                }
087                
088             public static final Map<String, String> ROUND_OPTION_MAP = new HashMap<String, String>(2);
089             static {
090                     ROUND_OPTION_MAP.put("T", "Traditional");
091                     ROUND_OPTION_MAP.put("R", "Truncate");
092             }
093             
094             public static final class RECORD_METHOD {
095                     public static final String TIME = "T";
096                     public static final String HOUR = "H";
097                     public static final String AMOUNT = "A";
098                     public static final String DAY = "D";
099             }
100             
101             public static final Map<String, String> RECORD_METHOD_MAP = new HashMap<String, String>(2);
102             static {
103                     RECORD_METHOD_MAP.put(RECORD_METHOD.TIME, "Time");
104                     RECORD_METHOD_MAP.put(RECORD_METHOD.HOUR, "Hours");
105                     RECORD_METHOD_MAP.put(RECORD_METHOD.AMOUNT, "Amount");
106                     RECORD_METHOD_MAP.put(RECORD_METHOD.DAY, "Days");
107             }
108            
109             public static final Map<String, String> ACCRUAL_BALANCE_ACTION_MAP = new LinkedHashMap<String, String>(2);
110             static {
111                     ACCRUAL_BALANCE_ACTION_MAP.put(ACCRUAL_BALANCE_ACTION.NONE, "None");
112                     ACCRUAL_BALANCE_ACTION_MAP.put(ACCRUAL_BALANCE_ACTION.USAGE, "Usage");
113                     ACCRUAL_BALANCE_ACTION_MAP.put(ACCRUAL_BALANCE_ACTION.ADJUSTMENT, "Adjustment");
114             }
115    
116         public static final class ACCRUAL_BALANCE_ACTION {
117            public static final String NONE = "N";
118            public static final String USAGE = "U";
119            public static final String ADJUSTMENT = "A";
120        }
121             
122             
123             public static final String LEAVE_CALENDAR_TYPE = "leaveCalendar";
124             
125             public static final class LEAVE_BLOCK_TYPE {
126                     public static final String LEAVE_CALENDAR = "LC";
127                     public static final String TIME_CALENDAR = "TC";
128                     public static final String ACCRUAL_SERVICE = "AS";
129                     public static final String BALANCE_TRANSFER = "BT";
130             public static final String LEAVE_PAYOUT = "LP";
131                     public static final String DONATION_MAINT = "DM";
132                     public static final String LEAVE_ADJUSTMENT_MAINT = "LAM";
133                     public static final String CARRY_OVER = "CO";
134             }
135    
136             public static final Map<String, String> LEAVE_BLOCK_TYPE_MAP = new HashMap<String, String>(8);
137             static {
138                            LEAVE_BLOCK_TYPE_MAP.put(LEAVE_BLOCK_TYPE.LEAVE_CALENDAR, "Leave Calendar");
139                            LEAVE_BLOCK_TYPE_MAP.put(LEAVE_BLOCK_TYPE.TIME_CALENDAR, "Time Calendar");
140                    LEAVE_BLOCK_TYPE_MAP.put(LEAVE_BLOCK_TYPE.ACCRUAL_SERVICE, "Accrual Service");
141                    LEAVE_BLOCK_TYPE_MAP.put(LEAVE_BLOCK_TYPE.BALANCE_TRANSFER, "Balance Transfer");
142                    LEAVE_BLOCK_TYPE_MAP.put(LEAVE_BLOCK_TYPE.LEAVE_PAYOUT, "Leave Payout");
143                    LEAVE_BLOCK_TYPE_MAP.put(LEAVE_BLOCK_TYPE.DONATION_MAINT, "Donation");
144                    LEAVE_BLOCK_TYPE_MAP.put(LEAVE_BLOCK_TYPE.LEAVE_ADJUSTMENT_MAINT, "Leave Adjustment");
145                    LEAVE_BLOCK_TYPE_MAP.put(LEAVE_BLOCK_TYPE.CARRY_OVER, "Carry Over");
146             }
147                
148        public static final class ACTION_AT_MAX_BAL {
149            public static final String LOSE = "L";
150            public static final String TRANSFER = "T";
151            public static final String PAYOUT = "P";
152        }
153    
154        public static final class MAX_BAL_ACTION_FREQ {
155            //As of revision 3882, constant LEAVE_APPROVE given value LA to remove discrepancy for value
156            //being set in LM_ACCRUAL_CATEGORY_RULES_T.MAX_BAL_ACTION_FREQ. Constant was defined as "L"
157            //table value being set is "LA"
158            public static final String LEAVE_APPROVE = "LA";
159            public static final String YEAR_END = "YE";
160                    public static final String ON_DEMAND = "OD";
161        }
162             
163             public static final String STATUS_CHANGE_EARN_CODE = "Accrual Note";
164             
165             public static final String RUN_ACCRUAL_FROM_CALENDAR = "run.accrual.from.calendar";   // controls if accrual should be ran from Leave calendar
166             
167             public static final String INITIATE_LEAVE_REQUEST_ACTION = "kpme.lm.leaveCalendar.initiate.leaveRequest.action";
168             public static final class INITIATE_LEAVE_REQUEST_ACTION_OPTIONS {
169                    public static final String DELETE = "DELETE";
170                    public static final String APPROVE = "APPROVE";
171             }
172             
173             public static final class TIME_APPROVAL_TYPE {
174                     public static final String TIME = "time";
175                     public static final String LEAVE = "leave";
176                     public static final String ALL = "all";
177             }
178             
179             public static final int DELINQUENT_LEAVE_CALENDARS_LIMIT = 2;
180             
181             public static final Map<String, String> EARN_CODE_USAGE_LIMIT_MAP = new LinkedHashMap<String, String>(2);
182             static {
183                     EARN_CODE_USAGE_LIMIT_MAP.put("I", "Include");
184                     EARN_CODE_USAGE_LIMIT_MAP.put("E", "Exclude");
185             }
186             
187             public static final class BALANCE_TRANSFER_TYPE {
188                     public static final String ACCRUAL_TRIGGERED = "AT";
189                     public static final String SSTO = "TO";
190                     public static final String MAINTENANCE = "MT";
191                     public static final String CARRY_OVER = "CO";
192             }
193             
194            public static final class UNUSED_TIME{
195                    public static final String NO_UNUSED = "NUTA";
196            public static final String TRANSFER = "T";
197            public static final String BANK = "B";
198            }
199                    
200            public static final Map<String, String> UNUSED_TIME_MAP = new HashMap<String, String>(7);
201        static {
202            UNUSED_TIME_MAP.put(UNUSED_TIME.NO_UNUSED, "No Unused Time Allowed");
203            UNUSED_TIME_MAP.put(UNUSED_TIME.TRANSFER, "Transfer");
204            UNUSED_TIME_MAP.put(UNUSED_TIME.BANK, "Bank");
205        }
206    }