{% import 'report/_chart_macros.html.twig' as C %}
{% set include = (payload.include ?? {}) %}
{% set currency = project.currency ?? 'XOF' %}
{% set totalAllocatedBudget = project.totalBudget %}
{% set ms = milestones|default([]) %}
{% set avgProg = project.progress %}
{% if project.responsible|default(null) and project.responsible.fullname|default(null) %}
{{ project.responsible.fullname }}
{% else %}
{{ project.status|default('—') }}
{% endif %}
Jours restants
{% set today = "now"|date("Y-m-d") %}
{% set endDate = project.endDate|default(null) %}
{% if endDate and endDate > today %}
{{ (endDate|date('U') - today|date('U')) / 86400 | round(0) }}j
{% else %}
Terminé
{% endif %}
Tâches complétées
78%
{% set committedPct = (project.totalCommittedBudget / project.totalBudget *100) %}
Budget engagé
{{ committedPct | number_format(0) }}%
{% set disbursedPct = (project.totalDisbursedBudget / project.totalBudget *100) %}
Budget liquidé
{{ disbursedPct | number_format(0) }}%
{% set today = "now"|date("Y-m-d") %}
{% set endDate = project.endDate|default(null) %}
{% if endDate and project.startDate %}
{% set totalDays = (endDate|date('U') - project.startDate|date('U')) / 86400 %}
{% set elapsedDays = (today|date('U') - project.startDate|date('U')) / 86400 %}
{% set elapsedPct = (elapsedDays / totalDays) * 100 %}
{% else %}
{% set elapsedPct = 0 %}
{% endif %}
Délai écoulé
{{ elapsedPct | number_format(0) }}%
Problèmes Récents
{% set items = issues|default([]) %}
{% if items is empty %}
Aucun problème signalé
{% else %}
{% set PRIORITY_COLOR = {'low':'#0ea5e9','medium':'#f59e0b','high':'#dc2626','critical':'#7f1d1d'} %}
{% set STATUS_COLOR = {'open':'#0ea5e9','in_progress':'#f59e0b','resolved':'#16a34a','closed':'#6b7280'} %}
{% for p in items|slice(0,3) %}
{% set pr = p.priority|default('medium')|lower %}
{% set st = p.status|default('open')|lower %}
{# Plan d’action (résolution) #}
{% if p.termsOfResolution|default(null) or p.solution|default(null) %}
Plan d’action
{% if p.termsOfResolution|default(null) %}
Voie de résolution : {{ p.termsOfResolution }}
{% endif %}
{% if p.solution|default(null) %}
{% set lines = (p.solution|trim)|split('\n') %}
{% if lines|length > 1 %}
{% for line in lines %}
{% set t = line|trim %}
{% if t is not empty %}
{{ t }}
{% endif %}
{% endfor %}
{% else %}
{{ p.solution|nl2br }}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if items|length > 3 %}
+{{ items|length - 3 }} autres problèmes
{% endif %}
{% endif %}
Indicateurs de Performance
{% if include.kpi %}
{% set k = kpi|default({}) %}
{% set cm = k.currentMonth|default({}) %}
{% set lm = k.lastMonth|default({}) %}
{% set mb = k.monthBeforeLast|default({}) %}