Files
2025-09-09 11:07:14 +02:00

51 lines
1.8 KiB
Plaintext

package templates
import (
"arbeitszeitmessung/models"
"arbeitszeitmessung/helper"
"time"
)
templ PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Time, tsEnd time.Time) {
{{
_, kw := tsStart.ISOWeek()
}}
@Base()
<content class="p-8 relative flex flex-col gap-4">
<div>
<h1 class="text-2xl font-bold">Kim Mustermensch</h1>
<p>Zeitraum: <span>{ tsStart.Format("02.01.2006") }</span> - <span>{ tsEnd.Format("02.01.2006") }</span></p>
<p>Arbeitszeit: <span></span></p>
<p>Überstunden: <span></span></p>
</div>
<div class="grid grid-rows-6 grid-cols-[auto_1fr_1fr_1fr_1fr_1fr_1fr] divide-x-1 divide-y-1">
<p class="p-2 text-center">{ kw }</p>
<p class="p-2 text-center">Kommen</p>
<p class="p-2 text-center">Gehen</p>
<p class="p-2 text-center">Arbeitsart</p>
<p class="p-2 text-center">Stunden gesamt</p>
<p class="p-2 text-center">Pause</p>
<p class="p-2 text-center">Überstunden</p>
for _, day := range workDays{
if day.Day.Weekday() == time.Monday {
<p class="p-2 col-span-7 text-center bg-neutral-300">Wochenende</p>
}
<p class="p-2 text-center">{ day.Day.Format("02.01.2006") }</p>
<div class="grid grid-cols-subgrid col-span-3">
for bookingI := 0; bookingI < len(day.Bookings); bookingI+= 2 {
<p class="p-2 text-center">{ day.Bookings[bookingI].Timestamp.Format("15:04") }</p>
<p class="p-2 text-center">{ day.Bookings[bookingI+1].Timestamp.Format("15:04") }</p>
<p class="p-2 text-center">{ day.Bookings[bookingI].BookingType.Name } </p>
}
</div>
{{ work, pause := day.GetWorkTimeString() }}
<p class="p-2 text-center">{ work }</p>
<p class="p-2 text-center">{ pause }</p>
<p class="p-2 text-center">{ helper.FormatDuration(day.CalcOvertime(e)) }</p>
}
</div>
</content>
}