From 853a36cb97373ca35ba109580f9951854eef1eff Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Tue, 31 Mar 2026 13:38:41 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20override=20D005=20display=20name=20from?= =?UTF-8?q?=20'BAZAR=205000'=20to=20'D=C3=A9p=C3=B4t'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/lib/pg-ff-client.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/pg-ff-client.ts b/src/lib/pg-ff-client.ts index f8dbeac..f798413 100644 --- a/src/lib/pg-ff-client.ts +++ b/src/lib/pg-ff-client.ts @@ -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