Skip to content

Commit

Permalink
Show a warning when overtime exceeds 75h
Browse files Browse the repository at this point in the history
  • Loading branch information
ccremer committed Jan 16, 2023
1 parent 53e0455 commit d794fb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/web/employeereport/employeereport_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion templates/employeereport.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1>Attendances for {{ .Month }} {{ .Year }}</h1>
<td class="text-end font-monospace">{{ .OutOfOfficeHours }}</td>
<td class="text-end font-monospace">{{ .PreviousBalance }}</td>
<td class="text-end font-monospace {{ .OvertimeClassName }}">{{ .OvertimeHours }}</td>
<td class="text-end font-monospace {{ .ProposedBalanceClassName }}">{{ .ProposedBalance }}</td>
<td class="text-end font-monospace {{ .ProposedBalanceClassName }}">{{ if .ProposedBalanceExceedsThreshold }}⚠️ {{ end }}{{ .ProposedBalance }}</td>
<td class="text-end font-monospace {{ .NextBalanceClassName }}" id="td-nextbalance-{{ .EmployeeID }}">{{ .NextBalance }}</td>
<td>
{{- if .OvertimeBalanceEditEnabled }}
Expand Down

0 comments on commit d794fb7

Please sign in to comment.