@php $tabs = [ 'overheads' => __('Labour & Overhead'), 'ink' => __('Ink Pass-Modes'), 'defaults' => __('Costing Defaults'), 'import' => __('Import from Excel'), ]; @endphp
@foreach ($tabs as $key => $label) @endforeach
{{-- ===================== LABOUR & OVERHEAD ===================== --}} @if ($tab === 'overheads')

{{ __('Labour & Overhead') }}

{{ __('Monthly costs are spread to a daily figure (÷ :n working days) and allocated per unit via each product\'s jobs-per-day.', ['n' => $workingDays]) }}

@if ($canManage)
{{ __('Labour') }} {{ __('Overhead') }}
@endif
@forelse ($operatingCosts as $oc) @empty @endforelse
{{ __('Name') }} {{ __('Type') }} {{ __('Monthly') }} {{ __('Daily') }} {{ __('Allocation') }} {{ __('Actions') }}
{{ $oc->name }} @if ($oc->isSourcedFromActuals()) {{ __('actuals: :c', ['c' => $oc->expenseCategory?->name ?? __('expenses')]) }} @endif {{ ucfirst($oc->type) }} {{ number_format($oc->effectiveMonthlyCost(), 2) }} @if ($oc->isSourcedFromActuals()) {{ __('manual: :m', ['m' => number_format((float) $oc->monthly_cost, 2)]) }} @endif {{ number_format($oc->dailyCost($workingDays), 2) }} {{ str_replace('_', ' ', $oc->allocation_basis) }} @if ($canManage)
@endif
@endif {{-- ===================== INK PASS-MODES ===================== --}} @if ($tab === 'ink')

{{ __('Ink Pass-Modes') }}

{{ __('Cost/m² = ml/m² × ink cost per ml (:c) × (1 + waste :w%).', ['c' => number_format($inkCostPerMl, 4), 'w' => rtrim(rtrim(number_format($inkWastePct, 2), '0'), '.')]) }}

@if ($canManage) {{ __('Pass-Mode') }} @endif
@forelse ($inkModes as $im) @empty @endforelse
{{ __('Mode') }} {{ __('ml / m²') }} {{ __('Cost / m²') }} {{ __('Actions') }}
{{ $im->name }} {{ rtrim(rtrim(number_format((float) $im->ml_per_sqm, 2), '0'), '.') }} {{ number_format($im->costPerSqm($inkCostPerMl, $inkWastePct), 2) }} @if ($canManage)
@endif
@endif {{-- ===================== DEFAULTS ===================== --}} @if ($tab === 'defaults')

{{ __('Costing Defaults') }}

{{ __('Used to spread overheads to daily costs, price ink, and pre-fill new products.') }}

{{ __('Pre-fills throughput on new products so auto-seeded overhead allocates sensibly.') }}

{{ __('Paste the shareable link (or id) of the directors\' costing sheet. Enables one-click sync on the Import tab. The sheet must be shared as “anyone with the link”.') }}

@if ($canManage)
{{ __('Save defaults') }}
@endif
@endif {{-- ===================== IMPORT FROM EXCEL ===================== --}} @if ($tab === 'import')

{{ __('Import from your costing spreadsheet') }}

{{ __('Seeds the rate master (labour, overhead, ink, exchange) and creates products with prices, DTF/EMB methods and quantity tiers. The Large Format (LFP) matrix also imports as a full per-component recipe. Re-running updates existing records (matched by name).') }}

@if ($canManage) {{-- One-click Google Sheets sync --}}

{{ __('Sync from Google Sheets') }}

@if ($google_costing_sheet_id !== '') {{ __('Pulls the live workbook straight from your saved Google Sheet link, no download needed.') }} @else {{ __('Add the Google Sheet link on the Costing Defaults tab to enable one-click sync.') }} @endif

{{ __('Sync now') }} {{ __('Syncing…') }}

{{ __('Or upload a file') }}

{{ __('Import spreadsheet') }} {{ __('Importing…') }}
@endif @if ($importResult)
@foreach ([ ['label' => __('Products'), 'value' => $importResult['counts']['products'] ?? 0], ['label' => __('Cost lines'), 'value' => $importResult['counts']['bom_lines'] ?? 0], ['label' => __('Price tiers'), 'value' => $importResult['counts']['tiers'] ?? 0], ['label' => __('Operating costs'), 'value' => $importResult['counts']['operating_costs'] ?? 0], ['label' => __('Ink modes'), 'value' => $importResult['counts']['ink_modes'] ?? 0], ['label' => __('Currencies'), 'value' => $importResult['counts']['currencies'] ?? 0], ] as $stat)

{{ $stat['value'] }}

{{ $stat['label'] }}

@endforeach
@if (! empty($importResult['notes']))
@foreach ($importResult['notes'] as $n)

⚠ {{ $n }}

@endforeach
@endif @endif
@endif
{{-- Operating cost modal --}} {{ $ocId ? __('Edit Operating Cost') : __('New Operating Cost') }}

{{ __('When linked, the monthly figure is taken live from this category\'s recurring expenses, so product costing always tracks real spend. The manual amount is kept as a fallback.') }}

{{ __('Cancel') }} {{ __('Save') }}
{{-- Ink mode modal --}} {{ $imId ? __('Edit Pass-Mode') : __('New Pass-Mode') }}
{{ __('Cancel') }} {{ __('Save') }}