@extends('adminlte::page') @section('content')
Case Info #{{ $case->case_number }}
@can('update', $case) Edit Case @endcan
Title
{{ $case->title }}
Client
@if($case->client) {{ $case->client->display_name ?? ($case->client->company_name ?: trim($case->client->first_name.' '.$case->client->last_name)) }} @else @endif
Primary Lawyer
{{ optional($case->primaryLawyer)->name ?? '—' }}
Type
{{ $case->case_type }}
Status
@php($statusClass = [ 'intake' => 'badge-secondary', 'active' => 'badge-success', 'pending' => 'badge-warning', 'closed' => 'badge-dark', 'archived' => 'badge-light', ][$case->status] ?? 'badge-secondary') {{ $case->status }}
Priority
@php($prioClass = [ 'low' => 'badge-light', 'medium' => 'badge-info', 'high' => 'badge-warning', 'urgent' => 'badge-danger', ][$case->priority] ?? 'badge-light') {{ $case->priority }}
Opened
{{ optional($case->date_opened)->format('Y-m-d') ?? '—' }}
Closed
{{ optional($case->date_closed)->format('Y-m-d') ?? '—' }}
Est. Value
{{ $case->estimated_value !== null ? 'Rp '.number_format($case->estimated_value,0,',','.') : '—' }}
Description
{{ $case->description ? Str::limit($case->description, 140) : '—' }}
Communications {{ $case->communications->count() }} @php($unreadCount = $case->communications->where('is_read', false)->count()) @if($unreadCount > 0) {{ $unreadCount }} unread @endif
@can('manage communications') New @endcan View All
@include('cases.partials.rows.communications', ['case' => $case])
Date Type Subject By Actions
@include('partials.datatables')
Activity
    @forelse($activities as $act)
  • {{ $act->created_at->format('Y-m-d H:i') }} — {{ ucfirst($act->description) }} @if($act->causer) by {{ $act->causer->name }} @endif
  • @empty
  • No recent activity
  • @endforelse
Tasks
@can('create', App\Models\Task::class) @endcan
@include('cases.partials.rows.tasks', ['case' => $case])
Title Assignee Due Status Actions
@include('partials.datatables')
Court Dates
@can('manage cases') @endcan
@include('cases.partials.rows.court_dates', ['case' => $case])
When Court Type Status Actions
@include('partials.datatables')
Documents
@can('create', App\Models\Document::class) @endcan
@include('cases.partials.rows.documents', ['case' => $case])
Name Type Size Actions
@include('partials.datatables')
Billing Snapshot
@can('create', App\Models\TimeEntry::class) @endcan
@include('cases.partials.rows.time_entries', ['case' => $case])
Date User Hours Billable
Total 0.00
@include('partials.datatables')
Expenses
@can('manage cases') @endcan
@include('cases.partials.rows.expenses', ['case' => $case]) @php($expTotal = $case->expenses->sum('amount'))
Date Category Description Amount Billable Actions
Total Rp {{ number_format($expTotal, 0, ',', '.') }}
@include('partials.datatables')
Invoices
@can('manage invoices') @endcan
@include('cases.partials.rows.invoices', ['case' => $case])
No Date Total Status Actions
@include('partials.datatables')
Profitability
Invoiced
Rp {{ number_format($case->invoices->sum('total_amount'), 0, ',', '.') }}
Expenses
Rp {{ number_format($case->expenses->sum('amount'), 0, ',', '.') }}
Net
Rp {{ number_format($case->invoices->sum('total_amount') - $case->expenses->sum('amount'), 0, ',', '.') }}
Note: Net = Invoiced total minus direct expenses. Future enhancement: include collected payments and non-billable time.
{{-- Quick Add Modals --}} @can('manage communications') @endcan @can('create', App\Models\Task::class) @endcan @can('create', App\Models\Document::class) @endcan @can('manage cases') @endcan @can('create', App\Models\TimeEntry::class) @endcan @can('manage cases') @endcan @can('manage cases') @endcan @include('cases.partials.task_quick_edit_modal') @include('cases.partials.invoice_quick_edit_modal') @include('cases.partials.court_date_quick_edit_modal') @can('manage invoices') @endcan @endsection @push('css') @endpush @push('js') @endpush