Documentation
¶
Index ¶
Constants ¶
View Source
const ( ReasonSickLeave = "Sick / Medical Consultation" ReasonOutsideOfficeHours = "Outside office hours" ReasonAuthorities = "Authorities" ReasonPublicService = "Requested Public Service" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DailySummary ¶
type DailySummary struct { Date time.Time Blocks []AttendanceBlock FTERatio float64 }
func NewDailySummary ¶
func NewDailySummary(fteRatio float64) *DailySummary
NewDailySummary creates a new instance. The fteRatio is the percentage (input a value between 0..1) of the employee and is used to calculate the daily maximum hours an employee should work.
func (*DailySummary) CalculateExcusedHours ¶
func (s *DailySummary) CalculateExcusedHours() float64
CalculateExcusedHours accumulates all hours that are excused in some way (sick leave etc) from that day.
func (*DailySummary) CalculateOvertime ¶
func (s *DailySummary) CalculateOvertime() time.Duration
CalculateOvertime returns the duration of overtime. If returned duration is positive, then the employee did overtime and undertime if duration is negative.
The overtime is then calculated according to these business rules:
- Outside office hours are multiplied by 1.5 (as a compensation)
- Excused hours like sick leave, authorities or public service can be used to "fill up" the daily theoretical maximum if the working hours are less than said maximum. However, there's no overtime possible using excused hours
- If the working hours exceed the theoretical daily maximum, then the excused hours are basically ignored. Example: it's not possible to work 9 hours, have 1 hour sick leave and expect 2 hours overtime for an 8 hours daily maximum, the overtime here is 1 hour.
func (*DailySummary) CalculateWorkingHours ¶
func (s *DailySummary) CalculateWorkingHours() float64
CalculateWorkingHours accumulates all working hours from that day. The outside office hours are multiplied with 1.5.
type Report ¶
type Report struct { DailySummaries []*DailySummary Summary Summary }
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
func (*Reporter) CalculateReportForMonth ¶
func (*Reporter) SetAttendances ¶
func (r *Reporter) SetAttendances(attendances []odoo.Attendance) *Reporter
Click to show internal directories.
Click to hide internal directories.