From 32d82107c1914c9bb8c22c03a74ca0248399c317 Mon Sep 17 00:00:00 2001 From: HirschleM Date: Mon, 27 Jan 2025 14:19:12 +0100 Subject: [PATCH] MH: VacationService Resturlaub Vorjahr auch einblenden ohne Nutzung --- Service/Plugins/VacationService.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Service/Plugins/VacationService.cs b/Service/Plugins/VacationService.cs index 49ba905c0..5e1a2c5a4 100644 --- a/Service/Plugins/VacationService.cs +++ b/Service/Plugins/VacationService.cs @@ -547,7 +547,22 @@ namespace BeWo.Service.Plugins Herkunft = string.Format("EmpOid:{0} Urlaubskonto:{1}", emp.EmployeeOid, year), Tooltip = null, IsDeletable = false - }) ; + }); + } + else if (urlaubskonten.ContainsKey(year - 1) && urlaubskonten[year - 1].Resturlaub > 0) + { + var vorherigesKonto = urlaubskonten[year - 1]; + aktuellesKonto.Value.ResturlaubVorjahrTotal += vorherigesKonto.Resturlaub; + aktuellesKonto.Value.ResturlaubVorjahr += vorherigesKonto.Resturlaub; + + dcs.Add(new UrlaubskontoDarstellungDC() + { + Erlaeuterung = "Resturlaub aus " + (year - 1) + " :", + AnzahlTage = string.Format("+{0:0.00}", aktuellesKonto.Value.ResturlaubVorjahrTotal), + Herkunft = string.Format("EmpOid:{0} Urlaubskonto:{1}", emp.EmployeeOid, year), + Tooltip = null, + IsDeletable = false + }); } var expDate = GetExpirationDate(year); if (expDate != null)