@extends('layouts.app') @section('title', 'My Timesheet') @section('breadcrumb')Timesheet@endsection @section('content')
started_at->toISOString() . "'" : 'null' }}, taskId: '', jobId: '', taskErr: false, jobErr: false, isTradesUser: {{ in_array(auth()->user()->role?->name, ['trades']) ? 'true' : 'false' }}, tick() { if (!this.startedAt) return; const diff = Math.floor((Date.now() - new Date(this.startedAt)) / 1000); const h = Math.floor(diff/3600), m = Math.floor((diff%3600)/60), s = diff%60; this.elapsed = (h>0?h+'h ':'')+m+'m '+s+'s'; }, tryStart() { this.taskErr = !this.isTradesUser && !this.taskId; this.jobErr = !this.jobId; if (this.taskErr || this.jobErr) return; this.running = true; $el.querySelector('form[data-timer-form]').submit(); } }" x-init="if(running) setInterval(()=>tick(), 1000)">

My Timesheet

Track your working hours and view your time entries

@if(in_array(auth()->user()->role?->name, ['office_admin','project_manager'])) All Staff @endif
This Week Hours
{{ number_format($weeklyHours, 1) }}h
{{ Carbon\Carbon::now()->startOfWeek()->format('M j') }} – {{ Carbon\Carbon::now()->endOfWeek()->format('M j') }}
@if(auth()->user()->hourly_rate)
This Week Earnings
${{ number_format($weeklyEarnings, 2) }}
@ ${{ number_format(auth()->user()->hourly_rate, 2) }}/hr
Hourly Rate
${{ number_format(auth()->user()->hourly_rate, 2) }}
per hour
@else
Rate
No hourly rate set — contact admin
@endif

Timer

{{ $running?->elapsed ?? '0m' }}
Timer running @if($running?->taskType) — {{ $running->taskType->name }} @endif @if($running?->job) — {{ $running->job->job_number }} @endif
@csrf
@if((auth()->user()->role?->name !== 'trades' && $errors->has('task_type_id')) || $errors->has('job_id'))
@foreach(auth()->user()->role?->name === 'trades' ? ['job_id'] : ['task_type_id','job_id'] as $field) @error($field)
{{ $message }}
@enderror @endforeach
@endif
@csrf @if(auth()->user()->role?->name !== 'trades')

Please select a task type.

@endif

Please select a job.

Recent Time Entries

@if(auth()->user()->hourly_rate) @endif @forelse($entries as $entry) @if(auth()->user()->hourly_rate) @endif @empty @endforelse
Date Task Job DurationAmountStatus Notes
{{ $entry->started_at->format('d M Y H:i') }} {{ $entry->taskType?->name ?? '—' }} {{ $entry->job?->job_number ?? '—' }} {{ $entry->elapsed }}${{ number_format($entry->duration_hours * auth()->user()->hourly_rate, 2) }} {{ ucfirst($entry->status) }} {{ $entry->notes ?? '—' }} @if($entry->status !== 'running' && !$entry->invoiced_in)
@csrf @method('DELETE')
@endif
No time entries yet. Start your first timer above.
@if($entries->hasPages())
{{ $entries->links() }}
@endif
@php $directRoles = ['factory_employee', 'processor', 'lead_installer']; @endphp @if(auth()->user()->hourly_rate && !in_array(auth()->user()->role?->name, $directRoles))
Ready to be invoiced?
Request invoice approval to notify admin & accounts for your time entries.
My Invoices
@endif
@endsection