diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cce0524c..1cbc73c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [2.14.0] - UNRELEASED +### Added + - Aggiunto piano ferie 15+2 + ### Changed - Corretta lista persone in Straordinario mensili gruppo, filtrando le persone non piĆ¹ affiliate + ## [2.13.0] - 2024-02-13 ### Added diff --git a/app/manager/services/absences/model/YearProgression.java b/app/manager/services/absences/model/YearProgression.java index 363183bcb..bf8b70ccd 100644 --- a/app/manager/services/absences/model/YearProgression.java +++ b/app/manager/services/absences/model/YearProgression.java @@ -176,6 +176,21 @@ public enum YearProgression { new YearPortion(320, 349, 1), new YearPortion(350, 366, 2))), + vacation15(15, ImmutableList.of( + new YearPortion(1, 15, 0), + new YearPortion(16, 45, 1), + new YearPortion(46, 75, 1), + new YearPortion(76, 106, 2), + new YearPortion(107, 136, 1), + new YearPortion(137, 167, 1), + new YearPortion(168, 197, 2), + new YearPortion(198, 227, 1), + new YearPortion(228, 258, 1), + new YearPortion(259, 288, 1), + new YearPortion(289, 319, 1), + new YearPortion(320, 349, 1), + new YearPortion(350, 366, 2))), + vacation11(11, ImmutableList.of( new YearPortion(1, 15, 0), new YearPortion(16, 45, 1), diff --git a/app/models/enumerate/VacationCode.java b/app/models/enumerate/VacationCode.java index 98f40694e..7a8acc497 100644 --- a/app/models/enumerate/VacationCode.java +++ b/app/models/enumerate/VacationCode.java @@ -35,6 +35,7 @@ public enum VacationCode { // Part-time verticali 3 giorni CODE_16_2("16+2", 16, 2), CODE_17_2("17+2", 17, 2), + CODE_15_2("15+2", 15, 2), // Part time verticali 50% o periodici 50% CODE_13_2("13+2", 13, 2), @@ -88,6 +89,9 @@ public int accruedVacations(int days) { if (this.vacations == 14) { return accruedProgression14(days); } + if (this.vacations == 15) { + return accruedProgression15(days); + } if (this.vacations == 16) { return accruedProgression16(days); } @@ -548,6 +552,53 @@ private int accruedProgression16(int days) { } return 16; } + + /** + * Progressione su 15 giorni. + * + * @param days giorni passati + * @return giorni maturati + */ + private int accruedProgression15(int days) { + + if (days <= 15) { + return 0; + } + if (days >= 16 && days <= 45) { + return 1; + } + if (days >= 46 && days <= 75) { + return 2; + } + if (days >= 76 && days <= 106) { + return 4; + } + if (days >= 107 && days <= 136) { + return 5; + } + if (days >= 137 && days <= 167) { + return 6; + } + if (days >= 168 && days <= 197) { + return 8; + } + if (days >= 198 && days <= 227) { + return 9; + } + if (days >= 228 && days <= 258) { + return 10; + } + if (days >= 259 && days <= 288) { + return 11; + } + if (days >= 289 && days <= 319) { + return 13; + } + if (days >= 320 && days <= 349) { + return 14; + } + return 15; + } /** * Progressione su 17 giorni. diff --git a/conf/messages.it b/conf/messages.it index 07d58c0ee..9b2a22d45 100755 --- a/conf/messages.it +++ b/conf/messages.it @@ -439,6 +439,7 @@ VacationCode.CODE_9_1= 9+1 VacationCode.CODE_13_2= 13+2 VacationCode.CODE_14_2= 14+2 VacationCode.CODE_23_3= 23+3 +VacationCode.CODE_15_2= 15+2 date= Data