{% extends 'entreprise/entreprise_base.html.twig' %} {% block title %}Facture - {{ loyer_mensuel.location.locataire.nomComplet }}{% endblock %} {% block body %} {# --- LOGIQUE DE CONTRÔLE & CONSTANTES --- #} {% set isExpired = (abonnementActuel is null or not abonnementActuel.isActive()) %} {% set canModify = (not isExpired) %} {% set currency = 'F.CFA' %} {% set solde = loyer_mensuel.soldeRestant %} {% set statutPaye = constant('App\\Entity\\Entreprise\\LoyerMensuel::STATUT_PAYE') %} {% set statutRetard = constant('App\\Entity\\Entreprise\\LoyerMensuel::STATUT_EN_RETARD') %}
{# --- EN-TÊTE : NAVIGATION ET ACTIONS --- #}

Période : {{ loyer_mensuel.mois|date_mois }} {{ loyer_mensuel.annee }}

Liste {% if solde > 0 and is_granted('ROLE_ENTREPRISE_COLLAB') %}
Paiement
{% endif %} {% if is_granted('ROLE_ENTREPRISE_COLLAB') %}
Modifier
{% endif %}
{% include 'flash_messages.html.twig' %}
{# --- COLONNE GAUCHE : DÉTAILS DE LA FACTURE --- #}
{# STATUT CARD #}
Locataire
{{ loyer_mensuel.location.locataire.nomComplet }}

{{ loyer_mensuel.location.locataire.email|default('Aucun email') }}

Bien Immobilier
{{ loyer_mensuel.location.appartement.immeuble.titre }}

{{ loyer_mensuel.location.appartement.titre }}

{# TABLEAU DES PRESTATIONS #}
Détail des charges
{% set charges = { 'Consommation d\'eau': loyer_mensuel.chargeEau, 'Electricité': loyer_mensuel.chargeElectricite, 'Gardiennage': loyer_mensuel.chargeGardien, 'Autres charges': loyer_mensuel.chargeAutre } %} {% for label, value in charges %} {% if value > 0 %} {% endif %} {% endfor %}
Désignation Montant
Loyer de base {{ loyer_mensuel.montantMensuel|number_format(0, '.', ' ') }} {{ currency }}
{{ label }} {{ value|number_format(0, '.', ' ') }} {{ currency }}
Total Net à payer {{ loyer_mensuel.totalDu|number_format(0, '.', ' ') }} {{ currency }}
{# HISTORIQUE #}
Historique des règlements
{% if loyer_mensuel.paiements is empty %}

Aucun versement enregistré.

{% else %}
{% for paiement in loyer_mensuel.paiements %} {% endfor %}
Référence Date Mode Montant
{{ paiement.reference }} {{ paiement.datePaiement|date('d/m/Y') }} {{ paiement.methodePaiement }} {{ paiement.montant|number_format(0, '.', ' ') }} {% if is_granted('ROLE_ENTREPRISE_COLLAB') %}
{% endif %}
{% endif %}
{# --- COLONNE DROITE : RÉSUMÉ FINANCIER & ACTIONS --- #}
{# CRÉANCE CARD #}
État du paiement
{% if loyer_mensuel.statut == statutPaye %}
Facture Réglée
{% elseif loyer_mensuel.statut == statutRetard %}
En Retard
{% else %}
Partiel / En attente
{% endif %}
Reste à percevoir {{ solde |format_money}}
{% set pct = (loyer_mensuel.totalDu > 0) ? (loyer_mensuel.montantPaye / loyer_mensuel.totalDu * 100) : 0 %}
Progression {{ pct|round }}%
{# ACTIONS RAPIDES #}
Actions rapides
{% endblock %}