✨ feat(promotion): Intègre la gestion et l'application des promotions au flux de réservation et au calcul du panier.
This commit is contained in:
@@ -394,13 +394,28 @@ export class FlowReserve extends HTMLAnchorElement {
|
||||
// --- RENDER FOOTER (TOTALS) ---
|
||||
const total = data.total || {};
|
||||
const hasTva = total.totalTva > 0;
|
||||
const promotion = data.promotion;
|
||||
|
||||
let promoHtml = '';
|
||||
let originalTotalHT = total.totalHT;
|
||||
|
||||
if (promotion && total.discount > 0) {
|
||||
originalTotalHT = total.totalHT + total.discount;
|
||||
promoHtml = `
|
||||
<div class="flex justify-between text-xs text-[#f39e36] font-bold uppercase">
|
||||
<span>${promotion.name} (-${promotion.percentage}%)</span>
|
||||
<span>-${this.formatPrice(total.discount)}</span>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
footer.innerHTML = `
|
||||
<div class="space-y-2 mb-6">
|
||||
<div class="flex justify-between text-xs text-slate-500 font-bold uppercase">
|
||||
<span>Total HT</span>
|
||||
<span>${this.formatPrice(total.totalHT)}</span>
|
||||
<span>${this.formatPrice(originalTotalHT)}</span>
|
||||
</div>
|
||||
${promoHtml}
|
||||
${hasTva ? `
|
||||
<div class="flex justify-between text-xs text-slate-500 font-bold uppercase">
|
||||
<span>TVA</span>
|
||||
|
||||
Reference in New Issue
Block a user