@php $statusMeta = [ 'outstanding' => ['label' => __('Outstanding'), 'color' => 'amber'], 'partially_returned' => ['label' => __('Partially returned'), 'color' => 'sky'], 'returned' => ['label' => __('Returned'), 'color' => 'emerald'], 'written_off' => ['label' => __('Written off'), 'color' => 'slate'], ]; $sourceColor = [ 'client_upfront' => 'sky', 'client_deposit' => 'sky', 'company' => 'violet', 'director' => 'indigo', 'loan' => 'rose', ]; @endphp

{{ __('Funding') }}

{{ __('Who put money into this job, and what still needs returning.') }}

{{ __('Funded') }}

{{ number_format($totalFunded, 2) }}{{ $baseCurrency }}

{{ __('To return') }}

{{ number_format($totalOutstanding, 2) }}{{ $baseCurrency }}

@if ($canManage) {{ __('Add funding') }} @endif
@forelse ($fundings as $funding)

{{ $funding->source_label }} {{ $statusMeta[$funding->status]['label'] ?? $funding->status }}

{{ $funding->funder_label }}

{{ optional($funding->funded_on)->format('Y-m-d') }}

{{ $funding->currency_code }} {{ number_format((float) $funding->amount, 2) }} @if ($funding->isRepayable()) ({{ __('out:') }} {{ number_format($funding->outstanding, 2) }}) @endif

@if ($canManage)
@if ($funding->isRepayable() && $funding->outstanding > 0) @endif
@endif
@empty
{{ __('No funding recorded for this job yet.') }}
@endforelse
{{ $editingId ? __('Edit Funding') : __('Add Funding') }}

{{ $this->lineRepayable ? __('Repayable, must be returned to the funder.') : __('Client money, not returned (except a refund).') }}

@if ($source === 'director')
@else
@endif
{{ __('Cancel') }} {{ __('Save') }}
{{ __('Record Return') }} @if ($returnFunding)
{{ __('Returning to') }} {{ $returnFunding->funder_label }} ({{ $returnFunding->source_label }}). {{ __('Outstanding:') }} {{ $returnFunding->currency_code }} {{ number_format($returnFunding->outstanding, 2) }}
@endif
{{ __('Cancel') }} {{ __('Record Return') }}