using IWorkDay interface for team
All checks were successful
Tests / Run Go Tests (push) Successful in 42s
All checks were successful
Tests / Run Go Tests (push) Successful in 42s
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
templ PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Time, tsEnd time.Time) {
|
||||
templ PDFReportEmploye(e models.User, workDays []models.IWorkDay, tsStart time.Time, tsEnd time.Time) {
|
||||
{{
|
||||
_, kw := tsStart.ISOWeek()
|
||||
noBorder := ""
|
||||
@@ -33,22 +33,32 @@ templ PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Ti
|
||||
noBorder = "border-b-0"
|
||||
}
|
||||
}}
|
||||
<p class={ noBorder }>{ day.Day.Format("02.01.2006") }</p>
|
||||
<p class={ noBorder }>{ day.Date().Format("02.01.2006") }</p>
|
||||
<div class={ "grid grid-cols-subgrid col-span-3 " + noBorder }>
|
||||
for bookingI := 0; bookingI < len(day.Bookings); bookingI+= 2 {
|
||||
<p>{ day.Bookings[bookingI].Timestamp.Format("15:04") }</p>
|
||||
<p>{ day.Bookings[bookingI+1].Timestamp.Format("15:04") }</p>
|
||||
<p>{ day.Bookings[bookingI].BookingType.Name } </p>
|
||||
if day.IsWorkDay() {
|
||||
{{
|
||||
workDay, _ := day.(*models.WorkDay)
|
||||
}}
|
||||
for bookingI := 0; bookingI < len(workDay.Bookings); bookingI+= 2 {
|
||||
<p>{ workDay.Bookings[bookingI].Timestamp.Format("15:04") }</p>
|
||||
<p>{ workDay.Bookings[bookingI+1].Timestamp.Format("15:04") }</p>
|
||||
<p>{ workDay.Bookings[bookingI].BookingType.Name } </p>
|
||||
}
|
||||
if workDay.IsKurzArbeit() {
|
||||
<p class="col-span-full">Kurzarbeit</p>
|
||||
}
|
||||
} else {
|
||||
{{
|
||||
absentDay, _ := day.(*models.Absence)
|
||||
}}
|
||||
<p class="col-span-full">{ absentDay.AbwesenheitTyp.Name }</p>
|
||||
}
|
||||
// if (day.Absence != models.Absence{}) {
|
||||
// <p class="col-span-full">{ day.Absence.AbwesenheitTyp.Name }</p>
|
||||
// }
|
||||
</div>
|
||||
{{ work, pause, overtime := day.GetAllWorkTimesReal(e) }}
|
||||
{{ work, pause, overtime := day.GetAllWorkTimesVirtual(e) }}
|
||||
@ColorDuration(work, noBorder)
|
||||
@ColorDuration(pause, noBorder)
|
||||
@ColorDuration(overtime, noBorder+" border-r-0")
|
||||
if day.Day.Weekday() == time.Friday {
|
||||
if day.Date().Weekday() == time.Friday {
|
||||
<p class="col-span-full bg-neutral-300">Wochenende</p>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user