{{-- resources/views/finance/client-profile.blade.php --}} @extends('layouts.finance.finance') @section('content')
Rs {{ number_format($totalInvoiced, 2) }}
Rs {{ number_format($totalCollected, 2) }}
Rs {{ number_format(max(0, $balanceDue), 2) }}
| Date | Type | Project ID | Reference / Detail | Amount | Status | {{-- NEW ACTION HEADER --}}Action |
|---|---|---|---|---|---|---|
| {{ \Carbon\Carbon::parse($item->created_at)->format('M d, Y - g:i A') }} | @if($modelType === 'Invoice') Invoice @else Payment Received @endif | Project #{{ $item->project_id }} | {{ $ref }} | {{ $modelType === 'Invoice' ? '' : '+' }}Rs {{ number_format($amount, 2) }} | @php $statusColor = in_array(strtolower($item->status ?? ''), ['paid', 'completed']) ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800'; @endphp {{ ucfirst($item->status ?? 'Logged') }} | {{-- NEW VIEW BUTTON --}}@if($modelType === 'Invoice') {{-- CHANGED HERE: finance.invoices.show --}} View PDF @else {{-- If the payment is tied to an invoice, view the invoice. Otherwise, view the project --}} @if(!empty($item->invoice_id)) {{-- CHANGED HERE: finance.invoices.show --}} View PDF @else View Project @endif @endif |
|
No financial activity found for this client yet.
|
||||||