finish interatred promotion
This commit is contained in:
@@ -123,7 +123,11 @@
|
||||
{% if active is defined and active != '' %}
|
||||
<div class="bg-white rounded-3xl p-6 md:p-10 shadow-xl border border-gray-100 animate-fade-in">
|
||||
{# Inclusion dynamique sécurisée #}
|
||||
{% include 'reservation/contrat/gestion_contrat/' ~ active ~ '.twig' ignore missing %}
|
||||
{% if active == 'contrats' %}
|
||||
{% include 'reservation/contrat/gestion_contrat/' ~ active ~ '.twig' with {'processedContrats': processedContrats} %}
|
||||
{% else %}
|
||||
{% include 'reservation/contrat/gestion_contrat/' ~ active ~ '.twig' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{# Message si aucune section n'est sélectionnée #}
|
||||
|
||||
@@ -12,8 +12,11 @@
|
||||
|
||||
{# --- LISTE DES CONTRATS --- #}
|
||||
<div class="grid grid-cols-1 gap-6">
|
||||
{% for contrat in customer.contrats %}
|
||||
{% for contrat in processedContrats|default(customer.contrats) %}
|
||||
<div class="bg-white rounded-[2.5rem] border border-gray-100 p-6 md:p-8 shadow-sm hover:shadow-xl transition-all duration-300 group">
|
||||
{% set dateAt = contrat.dateAt %}
|
||||
{% set endAt = contrat.endAt %}
|
||||
{% set days = (dateAt and endAt) ? dateAt.diff(endAt).days + 1 : 1 %}
|
||||
<div class="flex flex-col lg:flex-row gap-8">
|
||||
|
||||
{# COLONNE 1 : IDENTIFICATION ET LIEU #}
|
||||
@@ -41,6 +44,42 @@
|
||||
{{ contrat.zipCodeEvent }} {{ contrat.townEvent|upper }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{# Détails de la Réservation: Formule et Promotion #}
|
||||
<div class="bg-gray-50 rounded-2xl p-4 border border-gray-100">
|
||||
<div class="flex items-center gap-2 mb-2 text-gray-400">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" /></svg>
|
||||
<p class="text-[10px] font-bold uppercase tracking-widest">Détails de la Réservation</p>
|
||||
</div>
|
||||
<p class="text-sm font-bold text-gray-800 leading-snug">
|
||||
Durée: {{ days }} Jour(s)<br>
|
||||
{% if contrat.devis %}
|
||||
{% if contrat.devis.formule %}
|
||||
{% set formule = contrat.devis.formule %}
|
||||
Formule: {{ formule.name|default('N/A') }}<br>
|
||||
{% set fPrice = formule.price1j ?? 0 %}
|
||||
{% if days >= 2 and formule.price2j %}{% set fPrice = formule.price2j %}{% endif %}
|
||||
{% if days >= 5 and formule.price5j %}{% set fPrice = formule.price5j %}{% endif %}
|
||||
|
||||
{% if tvaEnabled %}
|
||||
{% set fPriceDisplay = fPrice * 1.20 %}
|
||||
{% else %}
|
||||
{% set fPriceDisplay = fPrice %}
|
||||
{% endif %}
|
||||
Prix Formule: {{ fPriceDisplay|number_format(2, ',', ' ') }} €<br>
|
||||
{% endif %}
|
||||
|
||||
{% set promotion = contrat.devis.orderSession.promotion|default(null) %}
|
||||
{% if promotion and promotion.percentage %}
|
||||
Promotion: -{{ promotion.percentage }}%
|
||||
{% endif %}
|
||||
{% else %}
|
||||
Formule: N/A<br>
|
||||
Promotion: N/A<br>
|
||||
Prix: N/A
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# COLONNE 2 : FINANCES ET ÉTAT DES PAIEMENTS #}
|
||||
@@ -50,15 +89,15 @@
|
||||
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4 mb-8">
|
||||
<div class="p-4 bg-blue-50/50 rounded-2xl border border-blue-100/50">
|
||||
<p class="text-[10px] font-bold text-blue-400 uppercase mb-1 tracking-tighter">Total Contrat</p>
|
||||
<p class="text-lg font-black text-blue-700">{{ contrat|totalContrat }} €</p>
|
||||
<p class="text-lg font-black text-blue-700">{{ contrat.totalTTC|number_format(2, ',', ' ') }} €</p>
|
||||
</div>
|
||||
<div class="p-4 bg-orange-50/50 rounded-2xl border border-orange-100/50">
|
||||
<p class="text-[10px] font-bold text-orange-400 uppercase mb-1 tracking-tighter">Arrhes (25%)</p>
|
||||
<p class="text-lg font-black text-orange-700">{{ (contrat|totalContrat * 0.25)|number_format(2, ',', ' ') }} €</p>
|
||||
<p class="text-lg font-black text-orange-700">{{ contrat.arrhes|number_format(2, ',', ' ') }} €</p>
|
||||
</div>
|
||||
<div class="p-4 bg-green-50/50 rounded-2xl border border-green-100/50">
|
||||
<p class="text-[10px] font-bold text-green-400 uppercase mb-1 tracking-tighter">Déjà versé</p>
|
||||
<p class="text-lg font-black text-green-700">{{ contrat|totalContratAccompte }} €</p>
|
||||
<p class="text-lg font-black text-green-700">{{ contrat.totalPaid|number_format(2, ',', ' ') }} €</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -220,20 +220,17 @@
|
||||
{% set promoPercentage = contrat.devis.orderSession.promotion.percentage %}
|
||||
{% endif %}
|
||||
|
||||
{% set totalHT_Discounted = totalHT * (1 - (promoPercentage / 100)) %}
|
||||
{% set totalTTC_Discounted = totalTTC * (1 - (promoPercentage / 100)) %}
|
||||
|
||||
{# TOTAL HT #}
|
||||
<div class="bg-white rounded-[1.5rem] p-6 border border-slate-100 shadow-sm flex justify-between items-center">
|
||||
<div>
|
||||
<p class="text-[9px] font-black text-slate-400 uppercase tracking-widest">Total Prestations</p>
|
||||
<p class="text-xs font-bold text-slate-400 italic">Hors Taxes (HT)</p>
|
||||
{% if promoPercentage > 0 %}
|
||||
<p class="text-[10px] text-slate-400 font-bold line-through decoration-red-400 decoration-2">{{ totalHT|number_format(2, ',', ' ') }}€</p>
|
||||
<p class="text-[10px] text-slate-400 font-bold line-through decoration-red-400 decoration-2">{{ totalHT_BeforeDiscount|number_format(2, ',', ' ') }}€</p>
|
||||
<p class="text-[10px] text-emerald-500 font-black uppercase tracking-wider">Promo -{{ promoPercentage }}%</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<p class="text-3xl font-black text-slate-900 italic tracking-tighter">{{ totalHT_Discounted|number_format(2, ',', ' ') }}€</p>
|
||||
<p class="text-3xl font-black text-slate-900 italic tracking-tighter">{{ totalHT|number_format(2, ',', ' ') }}€</p>
|
||||
</div>
|
||||
|
||||
{% if tvaEnabled %}
|
||||
@@ -242,14 +239,14 @@
|
||||
<p class="text-[9px] font-black text-slate-400 uppercase tracking-widest">Total Prestations</p>
|
||||
<p class="text-xs font-bold text-slate-400 italic">Total TVA</p>
|
||||
</div>
|
||||
<p class="text-3xl font-black text-slate-900 italic tracking-tighter">{{ (totalTTC_Discounted - totalHT_Discounted)|number_format(2, ',', ' ') }}€</p>
|
||||
<p class="text-3xl font-black text-slate-900 italic tracking-tighter">{{ (totalTTC - totalHT)|number_format(2, ',', ' ') }}€</p>
|
||||
</div>
|
||||
<div class="bg-white rounded-[1.5rem] p-6 border border-slate-100 shadow-sm flex justify-between items-center">
|
||||
<div>
|
||||
<p class="text-[9px] font-black text-slate-400 uppercase tracking-widest">Total Prestations</p>
|
||||
<p class="text-xs font-bold text-slate-400 italic">Total TTC</p>
|
||||
</div>
|
||||
<p class="text-3xl font-black text-slate-900 italic tracking-tighter">{{ totalTTC_Discounted|number_format(2, ',', ' ') }}€</p>
|
||||
<p class="text-3xl font-black text-slate-900 italic tracking-tighter">{{ totalTTC|number_format(2, ',', ' ') }}€</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -274,9 +271,9 @@
|
||||
{% for p in paymentCtaList %}{% set totalPaid = totalPaid + p.amount %}{% endfor %}
|
||||
|
||||
{% if tvaEnabled %}
|
||||
{% set newSolde = totalTTC_Discounted - totalPaid %}
|
||||
{% set newSolde = totalTTC - totalPaid %}
|
||||
{% else %}
|
||||
{% set newSolde = totalHT_Discounted - totalPaid %}
|
||||
{% set newSolde = totalHT - totalPaid %}
|
||||
{% endif %}
|
||||
|
||||
{# SOLDE FINAL - Bloc Principal avec saisie du montant #}
|
||||
|
||||
Reference in New Issue
Block a user