1 /*
2 * The Kuali Financial System, a comprehensive financial management system for higher education.
3 *
4 * Copyright 2005-2014 The Kuali Foundation
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 package org.kuali.kfs.module.bc.batch.service.impl;
20
21 import org.kuali.kfs.module.bc.batch.dataaccess.BudgetConstructionHumanResourcesPayrollInterfaceDao;
22 import org.kuali.kfs.module.bc.batch.service.BudgetConstructionHumanResourcesPayrollInterfaceService;
23 import org.springframework.transaction.annotation.Transactional;
24
25 @Transactional
26 public class BudgetConstructionHumanResourcesPayrollInterfaceServiceImpl implements BudgetConstructionHumanResourcesPayrollInterfaceService {
27
28 protected BudgetConstructionHumanResourcesPayrollInterfaceDao budgetConstructionHumanResourcesPayrollInterfaceDao;
29
30
31 /**
32 *
33 * @see org.kuali.kfs.module.bc.batch.service.BudgetConstructionHumanResourcesPayrollInterfaceService#refreshBudgetConstructionPosition(java.lang.Integer, boolean, boolean)
34 */
35 public void refreshBudgetConstructionPosition(Integer baseYear, boolean positionSynchOK, boolean CSFUpdateOK) {
36 /**
37 * base year positions are built only if current payroll information is still flowing into budget construction
38 * otherwise, the base year positions are frozen
39 */
40 Integer requestYear = baseYear+1;
41 if (positionSynchOK && CSFUpdateOK)
42 {
43 budgetConstructionHumanResourcesPayrollInterfaceDao.buildBudgetConstructionPositionBaseYear(baseYear);
44 }
45 /**
46 * request year positions are updated as long as human resources information is still flowing into budget construction
47 */
48 if (positionSynchOK)
49 {
50 budgetConstructionHumanResourcesPayrollInterfaceDao.buildBudgetConstructionPositonRequestYear(requestYear);
51 budgetConstructionHumanResourcesPayrollInterfaceDao.buildBudgetConstructionAdministrativePosts();
52 }
53 }
54
55 /**
56 *
57 * @see org.kuali.kfs.module.bc.batch.service.BudgetConstructionHumanResourcesPayrollInterfaceService#refreshBudgetConstructionIntendedIncumbent(java.lang.Integer, boolean, boolean)
58 */
59 public void refreshBudgetConstructionIntendedIncumbent(Integer baseYear, boolean positionSynchOK, boolean CSFUpdateOK, boolean BCUpdatesAllowed) {
60 Integer requestYear = baseYear+1;
61 /**
62 * the intended incumbent table is updated when human resources information is still flowing into budget construction.
63 * when this is no longer the case, only the names are updated (unless all of budget construction is no longer in update mode).
64 */
65 if (positionSynchOK)
66 {
67 if (CSFUpdateOK)
68 {
69 // we update the faculty level (full, associate, assistant, etc.) only if base payroll information is still flowing into budget construction.
70 // otherwise, we assume that the base payroll is "frozen" as a base-line for salary setting, and we stop allowing people to move between faculty levels.
71 // this version builds intended incumbent and updates faculty ranks.
72 budgetConstructionHumanResourcesPayrollInterfaceDao.buildBudgetConstructionIntendedIncumbentWithFacultyAttributes(requestYear);
73 }
74 else
75 {
76 // this version builds intended incumbent without adding anyone to the faculty levels.
77 budgetConstructionHumanResourcesPayrollInterfaceDao.buildBudgetConstructionIntendedIncumbent(requestYear);
78 }
79 }
80 else
81 {
82 // the name is always updated if the budget is in update mode, even if intended incumbent was not rebuilt because position synchronization was off.
83 if (BCUpdatesAllowed)
84 {
85 budgetConstructionHumanResourcesPayrollInterfaceDao.updateNamesInBudgetConstructionIntendedIncumbent();
86 }
87 }
88 }
89
90 public void setBudgetConstructionHumanResourcesPayrollInterfaceDao (BudgetConstructionHumanResourcesPayrollInterfaceDao budgetConstructionHumanResourcesPayrollInterfaceDao)
91 {
92 this.budgetConstructionHumanResourcesPayrollInterfaceDao = budgetConstructionHumanResourcesPayrollInterfaceDao;
93 }
94
95 }