{% extends 'layouts/authenticated.html.twig' %} {% block page_title %}{{ page_title|default('Reparation ' ~ repair.reference) }}{% endblock %} {% block content %}

{{ repair.reference }}

Reparation d'equipement

{{ repair.statusLabel }} Retour
{# Colonne principale #}
{# Informations generales #}

Informations

Reference
{{ repair.reference }}
Statut
{% set color = repair.statusBadgeColor %} {{ repair.statusLabel }} {% if repair.isOverdue %} En retard {% endif %}
Equipement
{{ repair.equipment.name|default('—') }}
Demande par
{{ repair.requestedBy ? repair.requestedBy.fullName : '—' }}
Date de demande
{{ repair.requestedAt|date('d/m/Y a H:i') }}
{% if repair.repairProvider %}
Prestataire
{{ repair.repairProvider }} {% if repair.repairProviderContact %} ({{ repair.repairProviderContact }}) {% endif %}
{% endif %} {% if repair.expectedReturnDate %}
Date de retour prevue
{{ repair.expectedReturnDate|date('d/m/Y') }} {% if repair.isOverdue %} {% endif %}
{% endif %} {% if repair.repairedAt %}
Date de reparation
{{ repair.repairedAt|date('d/m/Y a H:i') }}
{% endif %} {% if repair.returnedAt %}
Date de retour effectif
{{ repair.returnedAt|date('d/m/Y a H:i') }}
{% endif %}
{# Couts #} {% if repair.estimatedCost or repair.actualCost %}

Couts

{% if repair.estimatedCost %}
Cout estime
{{ repair.estimatedCost|number_format(0, ',', ' ') }} XOF
{% endif %} {% if repair.actualCost %}
Cout reel
{{ repair.actualCost|number_format(0, ',', ' ') }} XOF
{% endif %} {% if repair.costDifference is not null %}
Ecart
{{ repair.costDifference > 0 ? '+' : '' }}{{ repair.costDifference|number_format(0, ',', ' ') }} XOF
{% endif %}
{% endif %} {% if repair.description %}
Description du probleme
{{ repair.description|nl2br }}
{% endif %} {% if repair.diagnosis %}
Diagnostic
{{ repair.diagnosis|nl2br }}
{% endif %} {% if repair.partsReplaced %}
Pieces remplacees
{{ repair.partsReplaced|nl2br }}
{% endif %} {% if repair.conditionAfterRepair %}
Etat apres reparation
{{ repair.conditionAfterRepair }}
{% endif %} {% if repair.notes %}
Notes
{{ repair.notes|nl2br }}
{% endif %}
{# Timeline de statut #}

Progression

{% set steps = [ {key: 'requested', label: 'Demandee', icon: 'fa-clipboard'}, {key: 'diagnosed', label: 'Diagnostiquee', icon: 'fa-stethoscope'}, {key: 'in_repair', label: 'En reparation', icon: 'fa-wrench'}, {key: 'repaired', label: 'Reparee', icon: 'fa-check'}, {key: 'returned', label: 'Retournee', icon: 'fa-undo'} ] %} {% set statusOrder = {requested: 0, diagnosed: 1, in_repair: 2, repaired: 3, returned: 4, cancelled: -1} %} {% set currentIndex = statusOrder[repair.status]|default(0) %} {% if repair.status == 'cancelled' %}
Reparation annulee {% if repair.cancelReason %} - {{ repair.cancelReason }} {% endif %}
{% else %}
{% for step in steps %} {% set stepIndex = loop.index0 %} {% set isActive = repair.status == step.key %} {% set isPast = stepIndex < currentIndex %}
{{ step.label }}
{% if not loop.last %}
{% endif %} {% endfor %}
{% endif %}
{# Sidebar: Actions #}

Actions

{# Diagnostiquer #} {% if repair.canDiagnose %} {% endif %} {# Demarrer reparation #} {% if repair.canStartRepair %}
{% endif %} {# Marquer reparee #} {% if repair.canMarkRepaired %} {% endif %} {# Retourner equipement #} {% if repair.canReturn %}
{% endif %} {# Annuler #} {% if repair.canCancel %} {% endif %} {% if not repair.canDiagnose and not repair.canStartRepair and not repair.canMarkRepaired and not repair.canReturn and not repair.canCancel %}

Aucune action disponible

{% endif %}
{# Timeline historique #}

Historique

  1. Demandee

  2. {% if repair.diagnosedAt %}
  3. Diagnostiquee

  4. {% endif %} {% if repair.repairedAt %}
  5. Reparee

  6. {% endif %} {% if repair.returnedAt %}
  7. Retournee {% if repair.returnedBy %}par {{ repair.returnedBy.fullName }}{% endif %}

  8. {% endif %} {% if repair.cancelledAt %}
  9. Annulee

    {% if repair.cancelReason %}

    {{ repair.cancelReason }}

    {% endif %}
  10. {% endif %}
{% endblock %}