From 624d9ab851ad08573c72b9cd44a26e16cc650abc Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Mon, 30 Mar 2026 13:11:49 +0200 Subject: [PATCH] feat: add sync logic for procurement tables including orders, lines, and reappro plans --- sync/tables/appro.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sync/tables/appro.js b/sync/tables/appro.js index 75fac90..f5f13b5 100644 --- a/sync/tables/appro.js +++ b/sync/tables/appro.js @@ -1,5 +1,5 @@ const { getMssql, getPg } = require('../db'); -const { batchUpsert, fullRefresh, getLastSync, logSync } = require('../utils'); +const { batchUpsert, fullRefresh, getLastSync, logSync, safeStr, safeDecimal } = require('../utils'); const COMMANDE_FOU_COLS = [ 'no_id','cdenum','sit_cod_emet','sit_cod_desti','fouident_code', @@ -49,9 +49,9 @@ async function syncAppro(force) { port_code: r.PORT_CODE, cdedate: r.CDEDATE, cdeetat: r.CDEETAT, - cdetot: r.CDETOT ?? null, + cdetot: safeDecimal(r.CDETOT), cdetard: r.CDETARD ?? null, - cdeportmontant: r.CDEPORTMONTANT ?? null, + cdeportmontant: safeDecimal(r.CDEPORTMONTANT), cdeannulation: r.CDEANNULATION ?? null, suividatecreation: r.SUIVIDATECREATION, suividatemodif: r.SUIVIDATEMODIF,