package templates import ( "arbeitszeitmessung/helper" "arbeitszeitmessung/models" "fmt" "time" ) templ PDFForm(teamMembers []models.User) { @Base() @headerComponent()

PDF Abrechnung erstellen

Zeitraum wählen
Mitarbeiter wählen
for _, member := range teamMembers { @CheckboxComponent(fmt.Sprintf("pdf-%d", member.PersonalNummer), fmt.Sprintf("%s %s", member.Vorname, member.Name)) }
PDFs Bündeln
} templ CheckboxComponent(id, label string) {
} // templ PDFReportEmploye(e models.User, overtime, worktime time.Duration, workDays []models.IWorkDay, tsStart time.Time, tsEnd time.Time) { // {{ // _, kw := tsStart.ISOWeek() // noBorder := "" // }} // @Base() // //
//

{ e.Vorname } { e.Name }

//

Zeitraum: { tsStart.Format("02.01.2006") } - { tsEnd.Format("02.01.2006") }

//

Arbeitszeit: { helper.FormatDuration(worktime) }

//

Überstunden: { helper.FormatDuration(overtime) }

//
//
//

{ kw }

//

Kommen

//

Gehen

//

Arbeitsart

//

Stunden

//

Pause

//

Überstunden

// for index, day := range workDays { // {{ // if index == len(workDays)-1 { // noBorder = "border-b-0" // } // }} //

{ day.Date().Format("02.01.2006") }

//
// if day.IsWorkDay() { // {{ // workDay, _ := day.(*models.WorkDay) // }} // for bookingI := 0; bookingI < len(workDay.Bookings); bookingI+= 2 { //

{ workDay.Bookings[bookingI].Timestamp.Format("15:04") }

//

{ workDay.Bookings[bookingI+1].Timestamp.Format("15:04") }

//

{ workDay.Bookings[bookingI].BookingType.Name }

// } // if workDay.IsKurzArbeit() { // {{ // timeFrom, timeTo := workDay.GenerateKurzArbeitBookings(e) // }} //

{ timeFrom.Format("15:04") }

//

{ timeTo.Format("15:04") }

//

Kurzarbeit

// } // } else { // {{ // absentDay, _ := day.(*models.Absence) // }} //

{ absentDay.AbwesenheitTyp.Name }

// } //
// {{ work, pause, overtime := day.GetTimesVirtual(e) }} // @ColorDuration(work, noBorder) // @ColorDuration(pause, noBorder) // @ColorDuration(overtime, noBorder+" border-r-0") // if day.Date().Weekday() == time.Friday { //

Wochenende

// } // } //
//
// } templ ColorDuration(d time.Duration, classes string) { {{ color := "" if d.Abs() < time.Minute { color = "text-neutral-300" } }}

{ helper.FormatDurationFill(d, true) }

}