{{ $matter->subject }}

Status: {{ ucfirst($matter->status) }}
@if($matter->due_date)
Due Date: {{ $matter->due_date->format('M d, Y') }} @if($matter->isOverdue() && $matter->status !== 'completed') @endif
@endif
Priority: {{ ucfirst($matter->priority) }}
@if (session()->has('message'))
{{ session('message') }}
@endif @if (session()->has('success'))
{{ session('success') }}
@endif
@if(auth()->user()->canReadTimesheets())

Timesheet

@if(auth()->user()->canCreateTimesheets()) @endif @if(auth()->user()->canReadTimesheets()) Manage Timesheets @endif
@if($matter->hasExceededHours())
Exceeded Hours
{{ number_format($matter->exceeded_hours, 2) }}h
Over budget by {{ number_format($matter->exceeded_hours, 2) }} hours
Estimated Hours
{{ number_format($matter->total_estimated_hours, 2) }}h
Actual Hours
{{ number_format($matter->total_actual_hours, 2) }}h
@else
Remaining Hours
{{ number_format(max(0, $matter->total_estimated_hours - $matter->total_actual_hours), 2) }}h
Actual Hours
{{ number_format($matter->total_actual_hours, 2) }}h
@endif
@if($matter->timesheets->count() > 0)
@foreach($matter->timesheets->take(5) as $timesheet) @endforeach
Date User Description Time Actions
{{ $timesheet->date->format('d/m/Y') }} {{ $timesheet->createdBy->name }}
{{ $timesheet->description }}
{{ $timesheet->formatted_time_spent }}
@if(auth()->user()->canUpdateTimesheets()) @endif @if(auth()->user()->canDeleteTimesheets()) @endif
@if($matter->timesheets->count() > 5) @endif @else

No timesheet entries yet

Get started by adding your first timesheet entry.

@endif
@endif
@php $tasks = $filteredTasks; @endphp @if($tasks->count() > 0)
@foreach($tasks as $task) @endforeach
Task Assigned To Status Priority Due Date Actions
@if($task->assignedTo)
{{ substr($task->assignedTo->name, 0, 1) }}
{{ $task->assignedTo->name }}
@else Unassigned @endif
{{ ucfirst(str_replace('_', ' ', $task->status)) }} {{ ucfirst($task->priority) }} @if($task->due_date) {{ $task->due_date->format('M d, Y') }} @if($task->isOverdue() && $task->status !== 'expired') @endif @else No due date @endif
Edit @if($task->status !== 'completed') @endif
@if($tasks->hasPages())
{{ $tasks->links() }}
@endif @else

No tasks yet

Create your first task to get started

@endif

Matter Details

@if($editing) @endif
@if($editing)

{{ $matter->matter_id }}

{{ $matter->reference_number }}

@error('matterForm.subject') {{ $message }} @enderror
@error('matterForm.description') {{ $message }} @enderror
@error('matterForm.client_id') {{ $message }} @enderror

Role Assignments

@error('matterForm.angariador_user_id') {{ $message }} @enderror
@error('matterForm.coordenador_user_id') {{ $message }} @enderror
@error('matterForm.responsavel_user_id') {{ $message }} @enderror
@error('matterForm.executante_user_id') {{ $message }} @enderror
@error('matterForm.start_date') {{ $message }} @enderror
@error('matterForm.due_date') {{ $message }} @enderror
@error('matterForm.budget') {{ $message }} @enderror
@error('matterForm.estimated_hours') {{ $message }} @enderror
@foreach($teams as $value => $label) @endforeach
@error('matterForm.teams') {{ $message }} @enderror
@error('matterForm.notes') {{ $message }} @enderror
@else

Subject

{{ $matter->subject }}

Reference

{{ $matter->reference_number }}

Client

{{ $matter->client->company_name ?? 'No Client' }}

Role Assignments

{{ __('ANGARIADOR') }} ({{ __('ANGARIADOR') }}):

{{ $matter->angariadorUser->name ?? 'Not assigned' }}

{{ __('COORDENADOR') }} ({{ __('COORDENADOR') }}):

{{ $matter->coordenadorUser->name ?? 'Not assigned' }}

{{ __('RESPONSÁVEL') }} ({{ __('RESPONSÁVEL') }}):

{{ $matter->responsavelUser->name ?? 'Not assigned' }}

{{ __('EXECUTANTE') }} ({{ __('EXECUTANTE') }}):

{{ $matter->executanteUser->name ?? 'Not assigned' }}

Start Date

{{ $matter->start_date->format('M d, Y') }}

Due Date

@if($matter->due_date)

{{ $matter->due_date->format('M d, Y') }} @if($matter->isOverdue()) @endif

@else

No due date

@endif

Budget

{{ $matter->budget ? '€' . number_format($matter->budget, 2) : 'Not set' }}

Estimated Hours

{{ $matter->total_estimated_hours }} hours @if($matter->estimated_hours && $matter->total_estimated_hours > $matter->estimated_hours) +{{ $matter->total_estimated_hours - $matter->estimated_hours }}h @elseif($matter->estimated_hours && $matter->total_estimated_hours < $matter->estimated_hours) -{{ $matter->estimated_hours - $matter->total_estimated_hours }}h @endif

Hours Statistics

Estimated: {{ $matter->total_estimated_hours }} hours

Actual: {{ $matter->total_actual_hours }} hours

@if($matter->hasExceededHours())

Exceeded: {{ $matter->exceeded_hours }} hours

@endif

Teams

{{ $matter->team_names }}

@if($matter->description)

Description

{{ $matter->description }}

@endif @if($matter->notes)

Notes

{{ $matter->notes }}

@endif

Linked Proposal

@if($matter->proposal)
{{ $matter->proposal->title }} {{ $matter->proposal->proposal_id }}
@else
No proposal linked @if($availableProposals && $availableProposals->count() > 0)
@else No available proposals for this client @endif
@endif
@if($matter->proposal && $proposalItems->count() > 0)

Proposal Items

Matter Status:
@foreach($proposalItems as $item)
{{ $item->title }} {{ $item->status_label }}
@if($item->description)

{{ $item->description }}

@endif
Cost: €{{ number_format($item->cost, 2) }} @if($item->matter) Linked to: {{ $item->matter->subject }} @endif
@if($item->status === 'pending') @elseif($item->status === 'approved') ✓ Approved @elseif($item->status === 'rejected') ✗ Rejected @endif
@endforeach
@endif @endif

Matter Stats

@if($matter->total_estimated_hours > 0)
Hours Progress: {{ number_format(($matter->total_actual_hours / $matter->total_estimated_hours) * 100, 1) }}%
@if($matter->total_actual_hours > $matter->total_estimated_hours)
Exceeded by {{ number_format($matter->total_actual_hours - $matter->total_estimated_hours, 2) }} hours
@elseif($matter->total_actual_hours < $matter->total_estimated_hours)
{{ number_format($matter->total_estimated_hours - $matter->total_actual_hours, 2) }} hours remaining
@else
Hours exactly match estimate
@endif
@else
No estimated hours set for this matter. Please set estimated hours in the matter details to track progress.
@endif

Related

@if($matter->proposal)
Proposal

{{ $matter->proposal->title }}

@endif
Created By

{{ $matter->createdBy->name }}

Created

{{ $matter->created_at->format('M d, Y') }}

@if($matter->completed_date)
Completed

{{ $matter->completed_date->format('M d, Y') }}

@endif
@if(auth()->user()->canReadExpenses())

Expenses

@if(auth()->user()->canCreateExpenses() || auth()->user()->canManageExpenses())
@if(auth()->user()->canReadExpenses()) @endif
@endif
Total Expenses
€{{ number_format($matter->expenses->sum('total_amount'), 2) }}
@if($matter->expenses->count() > 0)
@foreach($matter->expenses->take(5) as $expense) @endforeach
Title Description Amount Actions
{{ $expense->name }}
{{ $expense->description ? Str::limit($expense->description, 60) : '-' }}
{{ $expense->formatted_total_amount }}
@if(auth()->user()->canUpdateExpenses()) @endif @if(auth()->user()->canDeleteExpenses()) @endif
@if($matter->expenses->count() > 5 && auth()->user()->canReadExpenses()) @endif @else

No expenses yet

Get started by adding your first expense.

@if(auth()->user()->canCreateExpenses() || auth()->user()->canManageExpenses())
@endif
@endif
@endif
@if(session()->has('success'))
{{ session('success') }}
@endif @if($itemToDelete)

Confirm Delete

Are you sure you want to delete this task? This action cannot be undone.

@endif @if($showExpenseModal)

{{ $editingExpenseId ? 'Edit Expense' : 'Add New Expense' }}

@error('expense_name') {{ $message }} @enderror
@error('expense_type_id') {{ $message }} @enderror
@error('expense_description') {{ $message }} @enderror
@error('amount') {{ $message }} @enderror
@error('expense_date') {{ $message }} @enderror
@error('invoice_file') {{ $message }} @enderror
@error('paid_by_office') {{ $message }} @enderror
@error('notes') {{ $message }} @enderror
@if($expenseUsers)

Select a user to create this expense on their behalf

@error('created_by') {{ $message }} @enderror
@endif
@endif @if($showTimesheetModal)

{{ $editingTimesheetId ? 'Edit Timesheet Entry' : 'Add Timesheet Entry' }}

@error('timesheetForm.description') {{ $message }} @enderror
@error('timesheetForm.time_spent') {{ $message }} @enderror
@error('timesheetForm.date') {{ $message }} @enderror

Hourly rate is set by system configuration

@if($timesheetForm['time_spent'] && $timesheetForm['hourly_rate'])
Estimated Cost: €{{ number_format($timesheetForm['time_spent'] * $timesheetForm['hourly_rate'], 2) }}
@endif @if($timesheetForm['time_spent'] && $matter->total_estimated_hours > 0) @php $newTotalHours = $matter->total_actual_hours + $timesheetForm['time_spent']; $willExceed = $newTotalHours > $matter->total_estimated_hours; $exceededAmount = $willExceed ? $newTotalHours - $matter->total_estimated_hours : 0; @endphp @if($willExceed)
Warning: Adding {{ number_format($timesheetForm['time_spent'], 2) }} hours will exceed the estimated hours by {{ number_format($exceededAmount, 2) }} hours.
Current: {{ number_format($matter->total_actual_hours, 2) }}h | Estimated: {{ number_format($matter->total_estimated_hours, 2) }}h | After adding: {{ number_format($newTotalHours, 2) }}h
@elseif($newTotalHours > ($matter->total_estimated_hours * 0.8))
Notice: Adding {{ number_format($timesheetForm['time_spent'], 2) }} hours will use {{ number_format(($newTotalHours / $matter->total_estimated_hours) * 100, 1) }}% of estimated hours.
Remaining after adding: {{ number_format($matter->total_estimated_hours - $newTotalHours, 2) }}h
@endif @endif
@endif