{{-- Left: Back button --}} {{-- Center: Title --}}

Contrôle {{ $control->year }} - {{ $control->residence->name }}

{{-- Right: Actions --}}
@if(auth()->user()->hasPermission('charge-controls-manage')) @endif
{{-- Error message from query param --}} @if(request('error'))
{{ request('error') }}
@endif {{-- Control summary card --}}
{{-- Status --}}
Statut
{{-- Period --}}
Période
@if($control->has_custom_period) {{ $control->period_label }} (période personnalisée) @else {{ $control->period_label }} @endif
{{-- Total Landlord --}}
Total bailleur
{{ number_format($control->total_landlord, 2, ',', ' ') }} €
{{-- Total Verified --}}
Total vérifié
{{ number_format($control->total_verified ?? 0, 2, ',', ' ') }} €
{{-- Difference --}}
Différence
{{ $control->difference > 0 ? '+' : '' }}{{ number_format($control->difference, 2, ',', ' ') }} €
{{-- Progress bar --}}
Progression / lignes vérifiées (%)
{{-- Heating period info --}} @if($control->heating_period_days)
Période de chauffe collectif : {{ $control->heating_period_days }} jours
@endif {{-- Notes --}} @if($control->notes)

Notes

{{ $control->notes }}

@endif
{{-- Lines grouped by parent category --}}

Lignes de contrôle

@forelse($groupedLines as $parentId => $lines) @php $parentCategory = $parentCategories[$parentId] ?? null; @endphp
{{-- Parent category header --}}

{{ $parentCategory?->code ?? '???' }} - {{ $parentCategory?->name ?? 'Catégorie inconnue' }}

{{-- Lines table --}}
@if(auth()->user()->hasPermission('charge-controls-manage')) @endif @foreach($lines as $line) { this.$refs.landlordInput.focus(); this.$refs.landlordInput.select(); }); } }"> @if(auth()->user()->hasPermission('charge-controls-manage')) @endif @endforeach {{-- Subtotal row --}}
Code Nature Montant bailleur Montant vérifié Différence StatutActions
{{ $line->category->code }} {{ $line->category->name }} {{ number_format($line->verified_amount ?? 0, 2, ',', ' ') }} € @if($line->difference !== null) {{ $line->difference > 0 ? '+' : '' }}{{ number_format($line->difference, 2, ',', ' ') }} € @else - @endif
@php $canDelete = $line->landlord_amount == 0 && $line->verified_amount === null && empty($line->comment); @endphp @if($canDelete) Supprimer cette ligne ? La ligne {{ $line->category->code }} - {{ $line->category->name }} sera supprimée.
@csrf @method('DELETE')
@else @endif
Sous-total {{ $parentCategory?->code ?? '' }} {{ number_format($lines->sum('verified_amount') ?? 0, 2, ',', ' ') }} €
@empty
Aucune ligne de contrôle.
@endforelse {{-- Grand total --}} @if($groupedLines->isNotEmpty())
TOTAL GÉNÉRAL {{ number_format($control->total_landlord, 2, ',', ' ') }} € {{ number_format($control->total_verified ?? 0, 2, ',', ' ') }} € {{ $control->difference > 0 ? '+' : '' }}{{ number_format($control->difference, 2, ',', ' ') }} €
@endif