From d794fb7eb878c9c92620487d1190d33f2e3caf85 Mon Sep 17 00:00:00 2001 From: ccremer Date: Mon, 16 Jan 2023 14:14:47 +0100 Subject: [PATCH] Show a warning when overtime exceeds 75h --- pkg/web/employeereport/employeereport_view.go | 1 + templates/employeereport.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/web/employeereport/employeereport_view.go b/pkg/web/employeereport/employeereport_view.go index ab206ed..e3ef29a 100644 --- a/pkg/web/employeereport/employeereport_view.go +++ b/pkg/web/employeereport/employeereport_view.go @@ -70,6 +70,7 @@ func (v *reportView) getValuesForReport(report timesheet.Report, previousPayslip "NextBalanceClassName": v.OvertimeClassname(nextBalance), "ProposedBalance": proposedBalanceCellText, "ProposedBalanceClassName": v.OvertimeClassname(proposedBalance), + "ProposedBalanceExceedsThreshold": proposedBalance.Hours() > 75 || proposedBalance.Hours() < -75, "OvertimeBalanceEditEnabled": nextPayslip != nil, "OvertimeBalanceEditPreviewValue": overtimeBalanceEditPreview, "ValidationError": validationErrorList.Error(), diff --git a/templates/employeereport.html b/templates/employeereport.html index 9282648..72cac56 100644 --- a/templates/employeereport.html +++ b/templates/employeereport.html @@ -112,7 +112,7 @@

Attendances for {{ .Month }} {{ .Year }}

{{ .OutOfOfficeHours }} {{ .PreviousBalance }} {{ .OvertimeHours }} - {{ .ProposedBalance }} + {{ if .ProposedBalanceExceedsThreshold }}⚠️ {{ end }}{{ .ProposedBalance }} {{ .NextBalance }} {{- if .OvertimeBalanceEditEnabled }}