Fiche resume du brief

{{ $brief->title }}

@if(auth()->user()->hasRole('admin')) Retour au projet @else Retour a mes briefs @endif
@php $statusCode = $brief->brifStatus?->code; $statusClasses = match ($statusCode) { 'en_cours' => 'bg-purple-50 text-purple-800 ring-purple-200', 'valide' => 'bg-emerald-50 text-emerald-800 ring-emerald-200', default => 'bg-slate-100 text-slate-700 ring-slate-200', }; $isProduction = $brief->primary_type === 'production'; $isAdvertising = $brief->isAdvertisingBrief(); $offers = $brief->offers->sortByDesc('created_at')->values(); $selectedOffer = $brief->selectedOffer; $charges = $brief->charges ?? collect(); $chargesTotal = (float) $charges->sum('amount'); $supplierCost = $isProduction ? $brief->resolvedSupplierCost() : 0.0; $estimatedPrice = (float) ($brief->estimated_price ?? 0); $sellingPrice = (float) ($brief->selling_price ?? 0); $margin = $sellingPrice > 0 && $estimatedPrice > 0 ? $sellingPrice - $estimatedPrice : null; $marginPct = $margin !== null && $estimatedPrice > 0 ? round(($margin / $estimatedPrice) * 100, 1) : null; $costBreakdown = $brief->getCostBreakdown(); $attachmentsCount = $brief->attachments->count(); $commentsCount = $brief->comments->count(); @endphp
{{-- Bandeau resume --}}
{{ $brief->brifStatus?->name ?? 'A faire' }} @if($isProduction) Production @else {{ $brief->briefType?->name ?? 'Conception' }} @if($isAdvertising) Publicite @endif @endif
{{ $offers->count() }} offre(s) {{ $attachmentsCount }} fichier(s) {{ $commentsCount }} commentaire(s)

Demande client

{{ $brief->project?->name ?? '—' }}

Client

{{ $brief->project?->client?->name ?? '—' }}

Deadline

{{ $brief->deadline?->format('d/m/Y') ?? '—' }}

Responsable

@if($isProduction) {{ $brief->responsable?->user?->name ?? 'Production Manager' }} @elseif($brief->briefStatusResponsableEmployer?->user) {{ $brief->briefStatusResponsableEmployer->user->name }} @else — @endif

{{-- Finances --}}

Finances & prix

Couts, charges et prix de vente du brief.

@if($isProduction)

Offre fournisseur

{{ $supplierCost > 0 ? number_format($supplierCost, 3, ',', ' ').' DT' : '—' }}

@if($brief->production_quantity)

{{ number_format((int) $brief->production_quantity, 0, ',', ' ') }} pieces

@endif

Charges

{{ $chargesTotal > 0 ? number_format($chargesTotal, 3, ',', ' ').' DT' : '—' }}

{{ $charges->count() }} ligne(s)

Cout total estime

{{ $estimatedPrice > 0 ? number_format($estimatedPrice, 3, ',', ' ').' DT' : '—' }}

Prix de vente

{{ $sellingPrice > 0 ? number_format($sellingPrice, 3, ',', ' ').' DT' : '—' }}

@if($margin !== null)

Marge : {{ number_format($margin, 3, ',', ' ') }} DT @if($marginPct !== null) ({{ $marginPct >= 0 ? '+' : '' }}{{ $marginPct }}%) @endif

@endif
@else

Cout estime

{{ $estimatedPrice > 0 ? number_format($estimatedPrice, 3, ',', ' ').' DT' : '—' }}

@if($isAdvertising && $estimatedPrice > 0)

Prix HT suggere facture : {{ number_format($brief->suggestedInvoiceUnitPrice(), 3, ',', ' ') }} DT

@endif

Prix de vente

{{ $sellingPrice > 0 ? number_format($sellingPrice, 3, ',', ' ').' DT' : '—' }}

@endif
@if(!empty($costBreakdown))

Detail du cout

@foreach($costBreakdown as $row)
{{ $row['name'] }} {{ number_format((float) $row['total_cost'], 3, ',', ' ') }} DT
@endforeach
@endif
{{-- Fiche technique production --}} @if($isProduction && $brief->production_designation)

Fiche technique

Designation
{{ \App\Models\Brief::PRODUCTION_DESIGNATIONS[$brief->production_designation] ?? $brief->production_designation }}
@if($brief->production_format)
Format
{{ $brief->production_format }}
@endif @if($brief->production_papier)
Papier
{{ $brief->production_papier }}
@endif @if($brief->production_impression)
Impression
{{ $brief->production_impression }}
@endif @if($brief->production_finition)
Finition
{{ $brief->production_finition }}
@endif @if($brief->production_quantity)
Quantite commandee
{{ number_format((int) $brief->production_quantity, 0, ',', ' ') }} pieces
@endif
@endif {{-- Offres fournisseurs --}} @if($isProduction)

Offres fournisseurs

{{ $offers->count() }} offre(s) enregistree(s)

@if($canAccessOffersComparison ?? false)
Gerer les offres @if($offers->count() >= 2) Comparer @endif
@endif
@if($selectedOffer)

Offre retenue

{{ $selectedOffer->name ?: ($selectedOffer->supplier?->name ?? 'Offre selectionnee') }}

{{ $selectedOffer->supplier?->name ?? '—' }}

@if($selectedOffer->description)

{{ $selectedOffer->description }}

@endif

{{ number_format($supplierCost, 3, ',', ' ') }} DT

{{ $selectedOffer->formattedDeliveryDays() }}

@elseif($offers->isNotEmpty())
Aucune offre n'a encore ete selectionnee.
@endif @if($offers->isEmpty())

Aucune offre fournisseur pour ce brief.

@if($canAccessOffersComparison ?? false) Ajouter une offre → @endif
@else
@foreach($offers as $offer) @endforeach
Offre Fournisseur Delai Prix Statut
{{ $offer->name ?: '—' }} {{ $offer->supplier?->name ?? '—' }} {{ $offer->formattedDeliveryDays() }} {{ number_format((float) $offer->price, 3, ',', ' ') }} DT @if(!empty($offer->pricing_tiers))
@foreach($offer->pricing_tiers as $tier)
{{ number_format((float) ($tier['quantity'] ?? 0), 0, ',', ' ') }} pcs → {{ number_format((float) ($tier['price'] ?? 0), 3, ',', ' ') }} DT
@endforeach
@endif
@if($offer->is_selected) Retenue @else En attente @endif
@endif
@endif {{-- Charges production --}} @if($isProduction)

Charges & frais

Deplacement, transport et autres frais lies au brief.

@if($canManageCharges ?? false) Gerer les charges @endif
@if($charges->isEmpty())
Aucune charge enregistree.
@else
@foreach($charges as $charge)

{{ $charge->name }}

@if($charge->creator)

Par {{ $charge->creator->name }} · {{ $charge->created_at?->format('d/m/Y') }}

@endif
{{ number_format((float) $charge->amount, 3, ',', ' ') }} DT
@endforeach
Total charges {{ number_format($chargesTotal, 3, ',', ' ') }} DT
@endif
@endif {{-- Description --}}

Description

@if($canEditBriefContent ?? false)
@csrf @method('PATCH') @else
{!! $brief->description ?: '

Aucune description.

' !!}
@endif
{{-- Plateformes publicitaires --}} @if($brief->adPlatforms->isNotEmpty())

Plateformes publicitaires

@foreach($brief->adPlatforms as $platform)

{{ $platform->adPlatformType?->name ?? $platform->platform }}

{{ $platform->start_date?->format('d/m/Y') }} → {{ $platform->end_date?->format('d/m/Y') }} @if($platform->budget_type_label) · {{ $platform->budget_type_label }} @endif

{{ number_format((float) $platform->budget, 2, ',', ' ') }} TND

@endforeach
@endif {{-- Brief lie createur --}} @if($brief->contentBrief)

Brief lie — Createur de contenu

{{ $brief->contentBrief->brifStatus?->name ?? 'A faire' }}

Titre

{{ $brief->contentBrief->title }}

Deadline

{{ $brief->contentBrief->deadline?->format('d/m/Y') ?? '—' }}

Intervenants

{{ $brief->contentBrief->employers->pluck('user.name')->filter()->implode(', ') ?: '—' }}

Description

{!! $brief->contentBrief->description ?: '

Aucune description.

' !!}
@endif
{{-- Sidebar --}} {{-- Fichiers & commentaires --}}
@include('employer-briefs.partials.attachments-section')
@include('employer-briefs.partials.comments-section')
@if($canEditBriefContent ?? false) @endif