feat: ajouter region_csc à toutes les références marchés
Implémente buildRef(r) dans calc.js : ref = id_marche + ' - ' + region_csc (ex: AO 58/2024 : Lot01 - ULS Gabes) Propagé dans : - services/calc.js → champ ref de normalizeMarche() - services/export-xlsx.js → toutes les cellules référence - routes/export.js → PPTX + DOCX (3 occurrences) - index.html → normalizeMarche() champ id_marche export-pdf.js déjà couvert via r.ref (utilise normalizeMarche) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2074893978
commit
7ca0eccb96
+8
-2
@@ -139,6 +139,12 @@ function niveauRisque(r) {
|
||||
|
||||
// ─── Normalisation d'un marché ───────────────────────────────────────────────
|
||||
|
||||
function buildRef(r) {
|
||||
const base = r.id_marche || r.reference || String(r.id || '');
|
||||
const reg = r.region_csc || r.region || '';
|
||||
return reg ? `${base} - ${reg}` : base;
|
||||
}
|
||||
|
||||
function normalizeMarche(r) {
|
||||
const obsValue = selectVal(r.observation);
|
||||
const natureValue = selectVal(r.nature);
|
||||
@@ -152,7 +158,7 @@ function normalizeMarche(r) {
|
||||
|
||||
return {
|
||||
id: r.id,
|
||||
ref: r.id_marche || r.reference || String(r.id || ''),
|
||||
ref: buildRef(r),
|
||||
projet: r.projet || '',
|
||||
region: r.region || r.region_csc || '',
|
||||
region_csc: r.region_csc || r.region || '',
|
||||
@@ -197,5 +203,5 @@ module.exports = {
|
||||
formatMontant, formatDateFR, formatPct,
|
||||
isCloture, getDelaiRestant, niveauAlerte,
|
||||
niveauAvancement, resultatFinancier, resultatPhysique, niveauRisque,
|
||||
normalizeMarche,
|
||||
normalizeMarche, buildRef,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user