off schedule on-site won't be given the day shift
This commit is contained in:
@@ -178,7 +178,7 @@ $allemails = $schedule.PSObject.Properties | ForEach-Object {
|
||||
$today = (Get-Date).Date
|
||||
|
||||
# ---| Specific date |---
|
||||
#$today = Get-Date -Day 27 -Month 10 -Year 2025 -Hour 9 -Minute 00 -Second 00 -Millisecond 00
|
||||
#$today = Get-Date -Day 20 -Month 10 -Year 2025 -Hour 9 -Minute 00 -Second 00 -Millisecond 00
|
||||
|
||||
$daysahead = 14 #How many days ahead to plan
|
||||
$timeoff_past_look = -7 #How many days to look into the past for the start of a multi-day time off
|
||||
@@ -211,7 +211,7 @@ try {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
$timeSpan = New-TimeSpan -Start $startSpanDate -End $endSpanDate
|
||||
Write-Debug("Planning from {0} to {1}" -f $startSpanDate, $endSpanDate)
|
||||
|
||||
@@ -337,7 +337,7 @@ try {
|
||||
else {
|
||||
# ---| LOOKING FOR THE SHIFT |---
|
||||
foreach ($shift in $shifts_today) {
|
||||
if($shift.UserId -eq $futureds_id) {
|
||||
if($shift.UserId -eq $futureds_id -and $shift.SharedShift.Notes -ne "On-site") {
|
||||
# ---| REMOVE THE SHIFT |---
|
||||
Remove-Shift -shift $shift -teamID $team.Id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user