@extends('layouts.master') @section('title', 'Matter Detail Report') @section('styles') @endsection @section('content')
Back to Matter Reports Reports Menu
Matter Detail Report
@if($errors->any())
    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@if($matter)
Download PDF
{{ $matter->matter_number }} — {{ $matter->matter_title }}
Matter detail statement
{{ $matter->status?->status_name ?? 'N/A' }} {{ $matter->type?->type_name ?? 'N/A' }}

Opened: {{ $matter->opened_date ? \Carbon\Carbon::parse($matter->opened_date)->format('M j, Y') : 'N/A' }}
Closed: {{ $matter->closed_date ? \Carbon\Carbon::parse($matter->closed_date)->format('M j, Y') : '-' }}
Priority: {{ $matter->priority?->priority_name ?? 'N/A' }}
Category: {{ $matter->category?->category_name ?? 'N/A' }}
@if(!empty($matter->description))
Description: {!! nl2br(e($matter->description)) !!}
@endif
Invoices Total
${{ number_format($totals['invoices_total'] ?? 0, 2) }}
Receipts Total
${{ number_format($totals['receipts_total'] ?? 0, 2) }}
Balance
${{ number_format($totals['balance'] ?? 0, 2) }}
Cases
{{ $matterCases->count() }}
Clients & Lawyers
Clients
@if(($matter->clients ?? collect())->count() > 0)
    @foreach($matter->clients as $c)
  • {{ $c->full_name ?? $c->fullName ?? $c->name ?? 'Client' }}
  • @endforeach
@else
No clients linked.
@endif
Lawyers
@if(($matterLawyers ?? collect())->count() > 0)
    @foreach($matterLawyers as $l) @php $nm = trim(($l->first_name ?? '') . ' ' . ($l->last_name ?? '')); if ($nm === '') $nm = (string) ($l->lawyer_id ?? 'Lawyer'); @endphp
  • {{ $nm }}{!! !empty($l->is_lead_lawyer) ? ' Lead' : '' !!}
  • @endforeach
@else
No lawyers linked.
@endif
Cases (subset of Matter)
@forelse($matterCases as $case) @empty @endforelse
Case # Case Name Client Type Status Court Appearance
{{ $case->case_id ?? ('CASE-' . $case->id) }} {{ $case->case_name ?? 'N/A' }} {{ optional($case->client)->full_name ?? 'N/A' }} {{ optional($case->caseType)->type_name ?? ($case->type_id ?? 'N/A') }} {{ optional($case->caseStatus)->status_name ?? ($case->status_code ?? 'N/A') }} {{ $case->court_appearance_date ? \Carbon\Carbon::parse($case->court_appearance_date)->format('M j, Y') : '-' }}
No cases linked to this matter.
Invoices
@forelse($invoices as $inv) @empty @endforelse @if($invoices->count() > 0) @endif
Invoice # Date Client Description Status Total Currency
{{ $inv->invoice_number }} {{ $inv->invoice_date ? $inv->invoice_date->format('Y-m-d') : 'N/A' }} {{ optional($inv->client)->full_name ?? 'N/A' }} {{ $inv->description ?? $inv->narration ?? '' }} {{ $inv->status ?? 'N/A' }} {{ number_format((float)($inv->total ?? 0), 2) }} {{ $inv->currency->currency_code ?? $inv->currency_id ?? 'N/A' }}
No invoices found for this matter.
Total {{ number_format((float)$invoices->sum('total'), 2) }}
Receipts
@forelse($receipts as $rec) @empty @endforelse @if($receipts->count() > 0) @endif
Receipt # Date Client Method Status Amount Currency
{{ $rec->receipt_number }} {{ $rec->receipt_date ? $rec->receipt_date->format('Y-m-d') : 'N/A' }} {{ optional($rec->client)->full_name ?? 'N/A' }} {{ $rec->payment_methods_label ?: ($rec->payment_method ?? 'N/A') }} {{ $rec->status ?? 'N/A' }} {{ number_format((float)($rec->total_amount ?? 0), 2) }} {{ $rec->currency_id ?? 'N/A' }}
No receipts found for this matter.
Total {{ number_format((float)$receipts->sum('total_amount'), 2) }}
Cashbook Entries
@forelse($cashbookEntries as $e) @empty @endforelse
Date Cashbook Reference Description Type Amount
{{ $e->transaction_date ? $e->transaction_date->format('Y-m-d') : 'N/A' }} {{ $e->cashbook?->name ?? 'N/A' }} {{ $e->reference ?? '' }} {{ $e->description ?? '' }} {{ $e->transaction_type ?? '' }} {{ number_format((float)($e->amount ?? 0), 2) }}
No cashbook entries linked to this matter.
@else
Select a matter and generate the report.
@endif
@endsection