From ae0e150bc1530fd6c771ce4f2a98019221b81e4a Mon Sep 17 00:00:00 2001 From: perco Date: Thu, 30 Apr 2026 21:22:00 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20rename=20fmt=E2=82=AC=20to=20fmtEuro=20(?= =?UTF-8?q?encoding=20issue)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/app.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/static/app.js b/static/app.js index 86e1a64..c28541a 100644 --- a/static/app.js +++ b/static/app.js @@ -38,8 +38,8 @@ async function loadDashboard() { const stats = document.getElementById('dash-stats'); stats.innerHTML = `
${d.active_rentals}
Location(s) en cours
-
${fmt€(d.revenue_month)}
Revenus ce mois
-
${fmt€(d.revenue_total)}
Revenus total
+
${fmtEuro(d.revenue_month)}
Revenus ce mois
+
${fmtEuro(d.revenue_total)}
Revenus total
${d.tools_count}
Outils
${d.clients_count}
Clients
${d.pending_deposit_return}
Cautions à rendre
@@ -75,9 +75,9 @@ function renderTools() {
${esc(t.name)}
${esc(t.category||'')}
- ${fmt€(t.daily_price)}/j - ${t.weekend_price ? `${fmt€(t.weekend_price)}/wk` : ''} - ${t.deposit ? `🔒 ${fmt€(t.deposit)}` : ''} + ${fmtEuro(t.daily_price)}/j + ${t.weekend_price ? `${fmtEuro(t.weekend_price)}/wk` : ''} + ${t.deposit ? `🔒 ${fmtEuro(t.deposit)}` : ''}
`; @@ -157,9 +157,9 @@ async function openToolDetail(id) {

${esc(t.name)} ${t.category ? `${esc(t.category)}` : ''}

-
${fmt€(t.daily_price)}
-
${t.weekend_price ? fmt€(t.weekend_price) : '—'}
-
${t.deposit ? fmt€(t.deposit) : '—'}
+
${fmtEuro(t.daily_price)}
+
${t.weekend_price ? fmtEuro(t.weekend_price) : '—'}
+
${t.deposit ? fmtEuro(t.deposit) : '—'}
${esc(t.description)||'—'}
${t.notes ? `
${esc(t.notes)}
` : ''}
@@ -167,7 +167,7 @@ async function openToolDetail(id) { ${rents.slice(0,5).map(r => `
👤 ${esc(r.client?.name||'')}
-
${fmtDate(r.start_date)} → ${fmtDate(r.end_date)}${fmt€(r.price)}${statusLabel(r.status)}
+
${fmtDate(r.start_date)} → ${fmtDate(r.end_date)}${fmtEuro(r.price)}${statusLabel(r.status)}
`).join('')} ${rents.length > 5 ? `
… et ${rents.length-5} autres
` : ''} @@ -283,7 +283,7 @@ async function openClientDetail(id) { ${c.rentals.slice(0,5).map(r => `
🔨 ${esc(r.tool_name)}
-
${fmtDate(r.start_date)} → ${fmtDate(r.end_date)}${fmt€(r.price)}${statusLabel(r.status)}
+
${fmtDate(r.start_date)} → ${fmtDate(r.end_date)}${fmtEuro(r.price)}${statusLabel(r.status)}
`).join('')} `; @@ -336,7 +336,7 @@ function renderRentals() {
🔨 ${esc(r.tool?.name||'')} — 👤 ${esc(r.client?.name||'')}
📅 ${fmtDate(r.start_date)} → ${fmtDate(r.end_date)} - 💶 ${fmt€(r.price)} + 💶 ${fmtEuro(r.price)} ${r.platform ? `🔗 ${esc(r.platform.name)}` : ''} ${statusLabel(r.status)} ${r.deposit_collected && !r.deposit_returned ? '🔒 Caution à rendre' : ''} @@ -378,7 +378,7 @@ function calcRentalPrice() { const isWeekend = days <= 3 && [6,0].includes(new Date(start).getDay()); const price = isWeekend && t.weekend_price ? t.weekend_price : t.daily_price * days; document.getElementById('rental-price').value = price.toFixed(2); - document.getElementById('rental-price-hint').textContent = `${days} jour(s) × ${fmt€(t.daily_price)} = ${fmt€(price)} (estimé)`; + document.getElementById('rental-price-hint').textContent = `${days} jour(s) × ${fmtEuro(t.daily_price)} = ${fmtEuro(price)} (estimé)`; } async function saveRental() { @@ -502,7 +502,7 @@ async function deletePlatform(id) { } // ─── Utils ────────────────────────────────────────────────────────────────── -function fmt€(v) { return Number(v).toLocaleString('fr-FR', {style:'currency', currency:'EUR'}); } +function fmtEuro(v) { return Number(v).toLocaleString('fr-FR', {style:'currency', currency:'EUR'}); } function fmtDate(d) { if(!d) return '—'; return new Date(d+'T00:00:00').toLocaleDateString('fr-FR'); } function esc(s) { return (s||'').replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"'); } function statusLabel(s) {