UrlaubsTermine deren Überschneidungen auswerten
Ein alter Ansatz der neu überarbeitet gehört..
Ich habe eine alte Urlaubsplanung die aktualisiert werden müsste und aktuell alle Mitarbeiter zusammenzählt die bei einem Termin eines Mirtarbeiters zuasammengezählt werden und eventuell vorwarnen wenn es zuviele sind .
Diese Rechnung stimmt zwar sagt aber nichts darüber aus das dieser Zustand an einem gewissen Tag erreicht wird wie im Bild am 12.1 und 13.1.
nun kommt der Moment für die Nussknacker unter euch denn ich komme da nicht weiter..
das ist der Code den ich aktuell verwende
let my := this;let myStart := start('Von - Bis');let myEnd := endof('Von - Bis');let mycnt := cnt(select Urlaub where Nr != my.Nr and (start('Von - Bis') >= myStart and start('Von - Bis') <= myEnd or endof('Von - Bis') >= myStart and endof('Von - Bis') <= myEnd or start('Von - Bis') <= myStart and endof('Von - Bis') >= myEnd));if Urlaub2018.ID <= 4 and mycnt <= 2 thenstyled("Führungscharge OK" + " " + mycnt, "green", "black", "ok")elseif Urlaub2018.ID <= 4 and mycnt >= 2 thenstyled("Führungscharge Achtung" + " " + mycnt, "yellow", "black", "warn")elseif Urlaub2018.ID > 4 and mycnt <= 3 thenstyled("Charge OK" + " " + mycnt, "green", "black", "ok")elseif Urlaub2018.ID > 4 and mycnt >= 3 thenstyled("Charge Achtung" + " " + mycnt, "yellow", "black", "warn")endendendend
und so sieht das Formular aus
2 Antworten
-
hmm irgenwo ist da der Wurm drinnen..
let my := this;let myn := days('Von (Inclusive)', 'Bis (Inclusive)');let myStart := 'Von (Inclusive)';let myEnd := 'Bis (Inclusive)';myEnd := date(myEnd) - myn;let myERG := 0;let mycnt := 0;for i in range(0, myn - 1) domycnt := 0;let mycnt := cnt(select Urlaub where Nr != my.Nrand date(myStart) + i >= date('Von (Inclusive)')and date(myStart) + i <= date('Bis (Inclusive)')and date(myEnd) - myn + i <= date('Bis (Inclusive)')and date(myEnd) - myn + i >= date('Von (Inclusive)'));if mycnt > myERG then myERG := mycnt endend;mycnt := myERG;if Urlaub2018.ID <= 4 and mycnt <= 2 thenstyled("Führungscharge OK" + " " + mycnt, "green", "black", "ok")elseif Urlaub2018.ID <= 4 and mycnt >= 2 thenstyled("Führungscharge Achtung" + " " + mycnt, "yellow", "black", "warn")elseif Urlaub2018.ID > 4 and mycnt <= 3 thenstyled("Charge OK" + " " + mycnt, "green", "black", "ok")elseif Urlaub2018.ID > 4 and mycnt >= 3 thenstyled("Charge Achtung" + " " + mycnt, "yellow", "black", "warn")endendendendmal rechnet es richtig mal falsch
-
so das Problem wurde gefunden und gelöst..
let my := this;let myn := days('Von (Inclusive)', 'Bis (Inclusive)');let myStart := 'Von (Inclusive)';let myEnd := 'Bis (Inclusive)';let myERG := 0;let mycnt := 0;for i in range(0, myn) dolet mycnt := cnt(select Urlaub where Nr != my.Nr and date(myStart) + i >= date('Von (Inclusive)') and date(myEnd) - myn + i <= date('Bis (Inclusive)'));if mycnt > myERG then myERG := mycnt end;mycnt := 0end;mycnt := myERG;if Urlaub.WacheID <= 4 and mycnt <= 2 thenstyled("Führungscharge OK" + " " + mycnt, "green", "black", "ok")elseif Urlaub.WacheID <= 4 and mycnt >= 2 thenstyled("Führungscharge Achtung" + " " + mycnt, "yellow", "black", "warn")elseif Urlaub.WacheID > 4 and mycnt <= 3 thenstyled("Charge OK" + " " + mycnt, "green", "black", "ok")elseif Urlaub.WacheID > 4 and mycnt >= 3 thenstyled("Charge Achtung" + " " + mycnt, "yellow", "black", "warn")endendendend
Content aside
- vor 6 JahrenZuletzt aktiv
- 2Antworten
- 1167Ansichten
