@php $fundingBadge = ['equity' => 'emerald', 'loan' => 'amber']; $spendBadge = ['asset' => 'indigo', 'expense' => 'slate', 'other' => 'sky']; // Tone → utility classes for the capital-structure health tags. $toneChip = [ 'emerald' => 'bg-emerald-50 text-emerald-600', 'amber' => 'bg-amber-50 text-amber-600', 'rose' => 'bg-rose-50 text-rose-600', 'slate' => 'bg-slate-100 text-slate-500', 'indigo' => 'bg-indigo-50 text-indigo-600', 'sky' => 'bg-sky-50 text-sky-600', ]; @endphp
{{-- Capital & Equity / Funding segmented control. These two registers of injected capital share one sidebar entry; the toggle moves between them (Funding no longer has its own sidebar link). --}} {{-- Header --}}

{{ __('Capital & Equity') }}

{{ __('Overview of shareholder contributions, equity, loans and funding.') }}

{{-- Four buttons in a row is 146px wider than a phone screen; unwrapped it widened the document and with it the fixed bottom dock. --}}
@if ($canManage) {{-- G12: money going the other way. Its own button, because "record a drawing" is a different intent from "record a contribution", and a direction buried inside the form is how owner drawings stay untracked. --}} @endif
{{-- KPI cards --}}
@foreach ($kpis as $kpi)

{{ $kpi['label'] }}

{{ $kpi['value'] }}

{{ $kpi['sub'] }}

@endforeach
{{-- Capital structure health --}}

{{ __('Capital Structure Health') }}

{{ __('Key financial ratios') }}

@foreach ($structureHealth as $stat)

{{ $stat['label'] }}

{{ $stat['value'] }}

{{ $stat['tag'] }}
@endforeach
{{-- Loans still owed, per lender --}} @if ($loansOwed->isNotEmpty())

{{ __('Owed to lenders') }}

{{ __('Money directors and others lent the company, less what has been paid back. Record a repayment as a drawing with the funding type set to Loan.') }}

@foreach ($loansOwed as $row) @endforeach
{{ __('Lender') }} {{ __('Lent') }} {{ __('Paid back') }} {{ __('Still owed') }}
{{ $row['label'] }} {{ $base }} {{ number_format($row['lent'], 2) }} {{ $base }} {{ number_format($row['repaid'], 2) }} {{ $base }} {{ number_format($row['owed'], 2) }}
{{ __('Total still owed') }} {{ $base }} {{ number_format($loansOutstanding, 2) }}
@endif {{-- Table --}}

{{ __('Capital Register') }}

{{ __('Equity, loans and owner drawings, in one ledger') }}

@forelse ($contributions as $c) @php $isDrawing = $c->isDrawing(); @endphp {{-- Signed: a drawing is money leaving the business, so it reads as a deduction rather than another contribution. --}} @empty @endforelse
{{ __('Date') }} {{ __('Contributor') }} {{ __('Description') }} {{ __('Type') }} {{ __('Funding Type') }} {{ __('Amount') }} {{ __('Method') }} {{ __('Actions') }}
{{ optional($c->contributed_on)->format('j M Y') }} {{ $c->contributor_label }} {{ $c->description }} @if ($isDrawing) {{-- The one thing a reader must not miss on this row. --}} {{ __('Drawing') }} @endif {{ __($fundingTypes[$c->funding_type] ?? $c->funding_type) }} {{ __($spendTypes[$c->spend_type] ?? $c->spend_type) }} {{ $isDrawing ? '− ' : '' }}{{ $c->currency_code }} {{ number_format((float) $c->amount, 2) }} {{ $c->payment_method_label }} {{-- The account the cash landed in (or left from). Blank rows are equity on paper only, the historical shape. --}} @if ($c->fundAccount) {{ $isDrawing ? __('from') : __('into') }} {{ $c->fundAccount->name }} @endif
@if ($canManage) @endif @if ($canDelete) @endif @if (! $canManage && ! $canDelete) — @endif
@if ($canManage) {{ __('Add Contribution') }} @endif
{{ $contributions->links() }}

{{ __('All amounts are in :code.', ['code' => $baseCode]) }} {{ __('Data is updated in real-time.') }}

{{-- Create / Edit modal --}} @php $formIsDrawing = $direction === \App\Models\CapitalContribution::DIRECTION_DRAWING; @endphp {{ $editingId ? ($formIsDrawing ? __('Edit Drawing') : __('Edit Contribution')) : ($formIsDrawing ? __('Record Owner Drawing') : __('Add Contribution')) }} {{-- Direction is the first decision on this form, because everything below means the opposite depending on which way the money went. --}}
@foreach ($directions as $key => $label) @php $active = $direction === $key; @endphp @endforeach
@if ($formIsDrawing)

{{ __('A drawing is not an expense. It never touches profit, it reduces the owner\'s stake in the business.') }}

@endif
{{-- "What it funded" only makes sense for money coming IN. --}}
@if ($funding_type === 'loan')
@endif

{{ $formIsDrawing ? __('Pick the account the owner took the cash from and treasury records the withdrawal.') : __('Pick the cashbox or bank the money went into and treasury records the deposit. Then pay the bill from that account as a normal expense. Do not also add an adjustment.') }}

{{ __('Cancel') }} {{ __('Save') }}
{{-- Import startup capital modal --}} {{ __('Import Startup Capital') }}

{{ __('Upload your "Startup Capital" sheet (.xlsx or .csv). Each line becomes a capital contribution: durable kit (printer, plotter, stands…) is capitalised as an asset, everything else as a setup expense, funded by equity, not booked as revenue.') }}

{{-- Expected columns --}}
{{ __('Expected columns (one row per purchase)') }}
{{ __('Date') }} {{ __('Description') }} {{ __('Amount') }} {{ __('Prince') }} {{ __('Ashly') }} {{ __('Debt') }} {{ __('Method') }}
2025-04-29{{ __('Large Format Printer') }}180010627380{{ __('Bank Transfer') }}
2025-05-02{{ __('Company Registration') }}150{{ __('Cash') }}

{{ __('Contributor columns are matched to team members by first name. A "Debt" / "Loan" column is recorded as a repayable director loan. Lines with no per-person split are recorded as unattributed equity. Re-importing the same sheet skips rows already on file.') }}

{{-- Sync from a Google Sheet link --}}

{{ __('Paste the share link of your Startup Capital sheet (set sharing to "Anyone with the link → Viewer"). Re-sync any time, rows already on file are skipped, so it never duplicates.') }}

{{ __('Load & sync') }} {{ __('Syncing…') }}
{{ __('or upload a file') }}
{{-- Upload --}}
{{-- Result --}} @if ($importResult)
@foreach ([ ['label' => __('Rows read'), 'value' => $importResult['rows']], ['label' => __('Contributions'), 'value' => $importResult['created']], ['label' => __('Assets created'), 'value' => $importResult['assets']], ['label' => __('Skipped'), 'value' => $importResult['skipped']], ] as $stat)

{{ $stat['value'] }}

{{ $stat['label'] }}

@endforeach
@endif
{{ __('Close') }} {{ __('Import') }} {{ __('Importing…') }}