fix: override D005 display name from 'BAZAR 5000' to 'Dépôt'

D005 is the main active supplier (95k+ articles, fournisseur principal)
but its historical name in the FF Nancy ERP is 'BAZAR 5000' since 2004.
The store no longer associates this code with BAZAR 5000 — it is their
Dépôt. Override via CASE WHEN in SQL since the ERP name cannot be changed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Sonnet 4.6 committed 2026-03-31 13:38:41 +02:00
1 parent cfd3a7e601
commit 853a36cb97
1 file changed
+3 -2
+3 -2
View File
@@ -660,8 +660,9 @@ export async function pgGetCaByFournisseur(
ORDER BY m.artnoid, m.datmvt DESC, af.no_id DESC
)
SELECT
lr.codefou AS code,
MAX(f.raisonsociale)::text AS nom,
lr.codefou AS code,
MAX(CASE WHEN lr.codefou = 'D005' THEN 'Dépôt'
ELSE f.raisonsociale END)::text AS nom,
m.site,
TO_CHAR(m.datmvt, 'YYYY-MM') AS mois,
SUM(-m.mntmvtttc)::float AS ca_ttc