MH: AutismusKoelnBonn Urlaubskonto Berechnung
This commit is contained in:
@@ -20,6 +20,31 @@ namespace KundeXyz.Service
|
||||
return list;
|
||||
}
|
||||
|
||||
public override decimal CalcCorrectNumberOfLeaveDaysForSpecialContractSituation(DateTime entryDate, DateTime? endDate, int anzahlArbeitstage, int restlicheTageImJahr, decimal? urlaubstageProJahr)
|
||||
{
|
||||
decimal urlaubstage = 0;
|
||||
if (urlaubstageProJahr == null)
|
||||
urlaubstageProJahr = 0m;
|
||||
|
||||
if (entryDate.Day == 1 && entryDate.Month == 1 || entryDate.Day == 2 && entryDate.Month == 1) //Erster Tag im Jahr
|
||||
{
|
||||
//Prüfen, ob Enddatum Ende des Jahres oder früher ist
|
||||
if (endDate == null || (endDate.HasValue && endDate.Value.Day == 31 && endDate.Value.Month == 12))
|
||||
urlaubstage = (decimal)urlaubstageProJahr;
|
||||
else
|
||||
urlaubstage = (decimal)urlaubstageProJahr / 365m * restlicheTageImJahr;
|
||||
}
|
||||
else
|
||||
{
|
||||
urlaubstage = (decimal)urlaubstageProJahr / 365m * restlicheTageImJahr;
|
||||
}
|
||||
|
||||
// Runden
|
||||
urlaubstage = UrlaubstageRunden(urlaubstage);
|
||||
|
||||
return urlaubstage;
|
||||
}
|
||||
|
||||
public override decimal UrlaubstageRunden(decimal urlaubstage)
|
||||
{
|
||||
if (urlaubstage - (int)urlaubstage <= 0.5m)
|
||||
|
||||
Reference in New Issue
Block a user