4 KiB
The kit_timesheet typst module
This file exhaustively documents the kit_timesheet typst module and its
exported values.
Quickstart
#import "kit_timesheet.typ" as ts
#ts.timesheet(
name: [McStudentface, Student],
staff_id: 1337420,
department: [Institut für Informatik],
working_area: ts.areas.Großforschung,
monthly_hours: 40,
hourly_wage: [14.09],
carry_prev_month: "02:30",
year: 2024,
month: 1,
ts.entry("Urlaub", 2, "12:00", "14:00", note: ts.notes.Urlaub),
ts.entry("Mate trinken", 3, "14:00", "15:30"),
ts.entry("Im Bett liegen", 4, "10:00", "12:00"),
ts.entry("Stundenzettel ausfüllen", 31, "14:00", "15:30", rest: "01:00"),
)
Times and durations
Some function arguments represent a time of day or a duration. They expect a
string of the form HH:MM or -HH:MM, e.g. 12:34. More specifically, the
string must match the regex ^-?[0-9]+:[0-5][0-9]$.
This makes it possible to specify negative durations, which can be useful if you
didn't work enough hours last month and want to specify a negative
carry_last_month value.
A time of day is just a duration starting from midnight (00:00).
Members
areas (dictionary)
The areas dict contains the enum-like string values accepted by the
working_area parameter of the timesheet function. See its documentation for
more detail.
Available entries are:
areas.Großforschung(value:"GF")areas.Unibereich(value:"UB")
notes (dictionary)
The notes dict contains the enum-like string values accepted by the note
parameter of the entry function. See its documentation as well as footnote 1
in the generated document for more detail.
Available entries are:
notes.Urlaub(value:"U")notes.Krankheit(value:"K")notes.Feiertage(value:"F")notes.Sonstiges(value:"S")
entry (function)
Create a single entry for the entries parameter of the timesheet function.
An entry corresponds exactly to a row in the resulting document.
Positional arguments:
task: What you worked on. Corresponds to the Tätigkeit column of the table.day: The day of month. Corresponds to the Datum column of the table.start: When you started working. Corresponds to the Beginn column of the table.end: When you stopped working. Corresponds to the Ende column of the table.
Named arguments:
rest(default:"00:00"): Break time. Corresponds to the Pause column of the table. If it wasn't a keyword, I'd have called itbreak:Dnote(default:none): Additional note for the Arbeitszeit column (whose value is automatically calculated). Entries with a note ofnotes.Urlaubare used to calculate the Urlaub anteilig field in the summary table. See thenotesdictionary for all available values.
timesheet (function)
Generate and validate a full timesheet.
Positional arguments:
..entries: All positional arguments are entries for the big table, created using theentryfunction.
Named arguments:
name: Your name (Name, Vorname).staff_id: Your staff id (Personalnummer).department: Your department (Organisationseinheit/OE).working_area: Your working area (Großforschung/GF or Unibereich/UB). Corresponds to the GF and UB checkboxes on the form. See theareasdictionary for all available values.monthly_hours: How many hours per month your contract says you should work (Vertraglich vereinbarte Arbeitszeit).hourly_wage: Your hourly wage (Stundensatz).validate(default:true): Whether the template should try to validate the data you entered (check if values look wrong, if you worked on a holiday, ...). If you turn this off, you can do funky things like work a negative amount of time or on Sundays.year: The year this time sheet is being generated for.month: The month this time sheet is being generated for.
timesheet_empty (function)
Generate an empty timesheet. Useful if you want to fill it out by hand. Not sure why anyone would want to do this though :P