mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-21 05:58:10 +02:00
feat: implement PostgreSQL bulk data client to replace per-article HTTP requests
This commit is contained in:
1 parent
a378bff7e2
commit
d96995fce9
1 file changed
+2
-2
@@ -854,13 +854,13 @@ export async function pgGetStockNegatif(site?: string): Promise<PgStockNegatifRo
|
|||||||
COALESCE(a.libelle1, '') AS libelle1,
|
COALESCE(a.libelle1, '') AS libelle1,
|
||||||
COALESCE(f.nom, af.code) AS fournisseur,
|
COALESCE(f.nom, af.code) AS fournisseur,
|
||||||
cs.site,
|
cs.site,
|
||||||
cs.stockdispo::float,
|
cs.qte::float AS stockdispo,
|
||||||
cs.dernierevente::text
|
cs.dernierevente::text
|
||||||
FROM cube_stock cs
|
FROM cube_stock cs
|
||||||
JOIN articles a ON a.no_id = cs.artnoid
|
JOIN articles a ON a.no_id = cs.artnoid
|
||||||
JOIN artfou1 af ON af.art_no_id = a.no_id AND af.preference = 1
|
JOIN artfou1 af ON af.art_no_id = a.no_id AND af.preference = 1
|
||||||
JOIN fouident f ON f.code = af.code
|
JOIN fouident f ON f.code = af.code
|
||||||
WHERE cs.stockdispo < 0
|
WHERE cs.qte < 0
|
||||||
AND cs.site IN ('292', '579')
|
AND cs.site IN ('292', '579')
|
||||||
${siteFilter}
|
${siteFilter}
|
||||||
ORDER BY cs.stockdispo ASC
|
ORDER BY cs.stockdispo ASC
|
||||||
|
|||||||
Reference in new issue
Block a user