{% extends 'base.html.twig' %} {% block body %}

{{ dossier.numDossier }} - {{ dossier.titre }} {{ dossier.status }} {% if dossier.priorite in ['URGENTE', 'CRITIQUE'] %} {{ dossier.priorite }} {% endif %}
{% if app.user.aDroit('dossier_modification') %} Modifier {% endif %} {% if app.user.aDroit('dossier_impression') %} Timeline Bon de sortie {% endif %} {% if app.user.aDroit('dossier_modification') %} {% endif %}
Informations générales
{% if dossier.assurance %} {% endif %} {% if dossier.dateCloture %} {% endif %} {% if dossier.montantFinal %} {% endif %} {% if dossier.observations %} {% endif %}
Client {{ dossier.client.raisonSociale }} {% if dossier.client.telephone %}
{{ dossier.client.telephone }} {% endif %}
Véhicule {% if dossier.vehicule.brand %}{{ dossier.vehicule.brand.name }}{% endif %} {% if dossier.vehicule.brandModele %}{{ dossier.vehicule.brandModele.nom }}{% endif %}
{{ dossier.vehicule.immatriculation }}
Assurance {{ dossier.assurance.raisonSociale }}
Date ouverture {{ dossier.dateDossier|date('d/m/Y') }}
Date clôture {{ dossier.dateCloture|date('d/m/Y') }}
Montant estimé {{ dossier.montantEstime|number_format(2, ',', ' ') }} DH
Montant final {{ dossier.montantFinal|number_format(2, ',', ' ') }} DH
Observations {{ dossier.observations|nl2br }}
{% if dossier.expert1 or dossier.expert2 or dossier.expert3 %}
Validations Experts
{% for expertNum in 1..3 %} {% set expertGetter = 'expert' ~ expertNum %} {% set statusGetter = 'expert' ~ expertNum ~ 'Status' %} {% set notesGetter = 'expert' ~ expertNum ~ 'Notes' %} {% if attribute(dossier, expertGetter) is not null %}

Expert {{ expertNum }}: {{ attribute(dossier, expertGetter).raisonSociale }}

{% if attribute(dossier, statusGetter) %}
{{ attribute(dossier, statusGetter) }}
{% endif %} {% if attribute(dossier, notesGetter) %}

{{ attribute(dossier, notesGetter)|nl2br }}

{% endif %}
{% for doc in dossier.documents %} {% if doc.categorie == 'VALIDATION_EXPERT' ~ expertNum %}
{{ doc.nom }} {% if app.user.aDroit('dossier_modification') %} {% endif %}
{% endif %} {% endfor %}
{% if app.user.aDroit('dossier_modification') %}
{% endif %}
{% endif %} {% endfor %} {% if dossier.expertValidationFinale %}
Validation finale accordée
{% endif %}
{% endif %}
Devis ({{ dossier.devis|length }})
{% if app.user.aDroit('devis_ajout') %} Nouveau {% endif %}
{% if dossier.devis is not empty %} {% for devis in dossier.devis %} {% endfor %}
N° Devis Date Montant Actions
{{ devis.numDevis }} {{ devis.dateDevis|date('d/m/Y') }} {{ devis.totalTtc|number_format(2, ',', ' ') }} DH
{% else %}

Aucun devis associé

{% endif %}
Réparations ({{ dossier.reparations|length }})
{% if app.user.aDroit('reparation_ajout') %} Nouvelle {% endif %}
{% if dossier.reparations is not empty %} {% for reparation in dossier.reparations %} {% endfor %}
N° O.R Type Statut Actions
{{ reparation.numReparation }} {{ reparation.reparationType ? reparation.reparationType.titre : '-' }} {% if reparation.estCloturee %} Clôturée {% else %} En cours {% endif %}
{% else %}

Aucune réparation associée

{% endif %}
Factures ({{ dossier.ventes|length }})
{% if app.user.aDroit('vente_ajout') %} Nouvelle {% endif %}
{% if dossier.ventes is not empty %} {% for vente in dossier.ventes %} {% endfor %}
N° Facture Date Montant Reliquat Actions
{{ vente.numVente }} {{ vente.dateVente|date('d/m/Y') }} {{ vente.totalTtc|number_format(2, ',', ' ') }} DH {% if vente.reliquat > 0 %} {{ vente.reliquat|number_format(2, ',', ' ') }} DH {% else %} Payé {% endif %}
{% else %}

Aucune facture associée

{% endif %}
Documents
{% if app.user.aDroit('dossier_modification') %} {% endif %}
{% for category in ['PHOTO_AVANT', 'PHOTO_APRES', 'PHOTO_DEGATS', 'DOCUMENT_ASSURANCE', 'DOCUMENT_EXPERT', 'AUTRE'] %}
{% set docs = dossier.documents|filter(d => d.categorie == category) %} {% if docs is not empty %}
{% for doc in docs %}
{% if doc.mimeType starts with 'image/' %} {{ doc.nom }} {% else %}

{{ doc.nom }}

{% endif %}

{{ doc.nom|slice(0, 30) }}...

{% if app.user.aDroit('dossier_modification') %} {% endif %}
{% endfor %}
{% else %}

Aucun document dans cette catégorie

{% endif %}
{% endfor %}
{% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}