3911012c65
Broad sweep across the whole codebase:
- Blade views (39 files, 315 wraps): tag-text and title/placeholder/alt
attributes wrapped with {{ __() }}. Excludes scripts, styles, @php,
@verbatim, {{ }}, {!! !!}, comments to avoid touching interpolations.
- PHP (54 files, 179 wraps): array 'key' => 'RO value' patterns and
list items with diacritics wrapped with __(). Reverted __() inside
const arrays (PHP disallows non-constant expressions).
- Added 269 new keys to lang/{ru,en}.json (identity fallback for
unknowns → 161 human RU + 163 EN translations added for the most
common enums, stages, roles, statuses, payment methods, vehicle
categories, warehouse, portal, form actions.
Missing translations fall back to RO so the UI never breaks. All 306
tests pass; view cache compiles cleanly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
106 lines
5.7 KiB
PHP
106 lines
5.7 KiB
PHP
<x-filament-panels::page>
|
|
<style>
|
|
.rc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
|
|
.rc-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
|
|
.dark .rc-card { background: #1f2937; border-color: #374151; }
|
|
.rc-h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
|
|
.rc-count { font-size: 11px; padding: 2px 8px; background: #f3f4f6; border-radius: 999px; color: #6b7280; }
|
|
.dark .rc-count { background: #374151; }
|
|
.rc-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
|
|
.rc-tbl td { padding: 6px 4px; border-bottom: 1px solid #f3f4f6; }
|
|
.rc-r { text-align: right; }
|
|
.rc-empty { color: #9ca3af; text-align: center; padding: 16px 0; font-size: 12px; }
|
|
</style>
|
|
|
|
@php
|
|
$lost = $this->lostClients();
|
|
$highMileage = $this->highMileageVehicles();
|
|
$unpaid = $this->unpaidWO();
|
|
$vip = $this->vipNeedingTouchup();
|
|
@endphp
|
|
|
|
<div class="rc-grid">
|
|
<div class="rc-card">
|
|
<div class="rc-h3">{{ __('😴 Clienți pierduți') }} <span class="rc-count">{{ $lost->count() }}</span></div>
|
|
<div style="font-size:11px;color:#6b7280;margin-bottom:12px;">{{ __('Clienți care n-au mai venit de peste 6 luni — bun moment pentru un mesaj de revenire.') }}</div>
|
|
<table class="rc-tbl">
|
|
@forelse ($lost as $c)
|
|
<tr>
|
|
<td>
|
|
<a href="{{ route('filament.tenant.resources.clients.edit', ['record' => $c->id]) }}" style="color:inherit;text-decoration:underline;">{{ $c->name }}</a>
|
|
<div style="font-size:10px;color:#9ca3af;">{{ $c->phone }}</div>
|
|
</td>
|
|
<td class="rc-r" style="color:#9ca3af;font-size:11px;">
|
|
{{ __('ultima fișă') }}<br>{{ $c->workOrders->first()?->opened_at?->diffForHumans() ?? '—' }}
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="2" class="rc-empty">Niciun client pierdut. 🎉</td></tr>
|
|
@endforelse
|
|
</table>
|
|
</div>
|
|
|
|
<div class="rc-card">
|
|
<div class="rc-h3">{{ __('🚗 Mașini cu kilometraj mare') }} <span class="rc-count">{{ $highMileage->count() }}</span></div>
|
|
<div style="font-size:11px;color:#6b7280;margin-bottom:12px;">{{ __('Sugerează revizie / piese de uzură.') }}</div>
|
|
<table class="rc-tbl">
|
|
@forelse ($highMileage as $v)
|
|
<tr>
|
|
<td>
|
|
{{ $v->make }} {{ $v->model }} {{ $v->year }}
|
|
@if ($v->plate) <b>[{{ $v->plate }}]</b> @endif
|
|
<div style="font-size:10px;color:#9ca3af;">{{ $v->client?->name }}</div>
|
|
</td>
|
|
<td class="rc-r" style="font-weight:600;color:#d97706;">
|
|
{{ number_format($v->mileage, 0, '.', ' ') }} km
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="2" class="rc-empty">—</td></tr>
|
|
@endforelse
|
|
</table>
|
|
</div>
|
|
|
|
<div class="rc-card">
|
|
<div class="rc-h3">{{ __('💰 Fișe neplătite') }} <span class="rc-count">{{ $unpaid->count() }}</span></div>
|
|
<div style="font-size:11px;color:#6b7280;margin-bottom:12px;">{{ __('Sună-i sau trimite-le un email cu suma datorată.') }}</div>
|
|
<table class="rc-tbl">
|
|
@forelse ($unpaid as $w)
|
|
<tr>
|
|
<td>
|
|
<a href="{{ route('filament.tenant.resources.work-orders.edit', ['record' => $w->id]) }}" style="color:inherit;text-decoration:underline;">{{ $w->number }}</a>
|
|
— {{ $w->client?->name }}
|
|
<div style="font-size:10px;color:#9ca3af;">{{ $w->vehicle?->make }} {{ $w->vehicle?->model }} {{ $w->vehicle?->plate ? '[' . $w->vehicle->plate . ']' : '' }}</div>
|
|
</td>
|
|
<td class="rc-r" style="color:#dc2626;font-weight:600;">
|
|
{{ number_format(max(0, (float) $w->total - (float) $w->payments->sum('amount')), 2, '.', ' ') }} MDL
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="2" class="rc-empty">{{ __('Niciun rest de încasat. 🎉') }}</td></tr>
|
|
@endforelse
|
|
</table>
|
|
</div>
|
|
|
|
<div class="rc-card">
|
|
<div class="rc-h3">{{ __('⭐ VIP fără contact recent') }} <span class="rc-count">{{ $vip->count() }}</span></div>
|
|
<div style="font-size:11px;color:#6b7280;margin-bottom:12px;">{{ __('Clienți VIP cu care nu s-a vorbit de peste 30 zile.') }}</div>
|
|
<table class="rc-tbl">
|
|
@forelse ($vip as $c)
|
|
<tr>
|
|
<td>
|
|
{{ $c->name }}
|
|
<div style="font-size:10px;color:#9ca3af;">{{ $c->phone }}</div>
|
|
</td>
|
|
<td class="rc-r" style="color:#9ca3af;font-size:11px;">
|
|
{{ $c->last_contact_at?->diffForHumans() ?? 'niciodată' }}
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="2" class="rc-empty">{{ __('Toți VIP-ii sunt în contact recent.') }}</td></tr>
|
|
@endforelse
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</x-filament-panels::page>
|