mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-11 17:26:32 +02:00
fix: replace IN() with OR conditions in analytics SQL for Drizzle compatibility
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
d8a9bf80a0
commit
c9df9feccd
1 file changed
+4
-4
@@ -655,11 +655,11 @@ export async function pgGetCaByFournisseur(
|
||||
JOIN articles a ON a.no_id = m.artnoid
|
||||
JOIN artfou1 af ON af.art_no_id = a.no_id
|
||||
JOIN fouadr1 f ON f.code = af.code AND f.sit_code = '000'
|
||||
WHERE TO_CHAR(m.datmvt, 'YYYY-MM') IN (${mois}, ${moisN1})
|
||||
WHERE (TO_CHAR(m.datmvt, 'YYYY-MM') = ${mois} OR TO_CHAR(m.datmvt, 'YYYY-MM') = ${moisN1})
|
||||
AND m.site IN ('292', '579')
|
||||
AND m.genremvt = 3
|
||||
GROUP BY af.code, m.site, TO_CHAR(m.datmvt, 'YYYY-MM')
|
||||
ORDER BY af.code, m.site, mois
|
||||
ORDER BY af.code, m.site, TO_CHAR(m.datmvt, 'YYYY-MM')
|
||||
`);
|
||||
|
||||
console.log(`[pg-ff] CaByFournisseur: ${result.rows.length} lignes pour ${mois}/${moisN1}`);
|
||||
@@ -683,11 +683,11 @@ export async function pgGetCaByNomenclature(
|
||||
FROM mvtart m
|
||||
JOIN articles a ON a.no_id = m.artnoid
|
||||
JOIN nomenclature n ON n.no_id = a.nom_no_id
|
||||
WHERE TO_CHAR(m.datmvt, 'YYYY-MM') IN (${mois}, ${moisN1})
|
||||
WHERE (TO_CHAR(m.datmvt, 'YYYY-MM') = ${mois} OR TO_CHAR(m.datmvt, 'YYYY-MM') = ${moisN1})
|
||||
AND m.site IN ('292', '579')
|
||||
AND m.genremvt = 3
|
||||
GROUP BY n.code, n.libelle, m.site, TO_CHAR(m.datmvt, 'YYYY-MM')
|
||||
ORDER BY n.code, m.site, mois
|
||||
ORDER BY n.code, m.site, TO_CHAR(m.datmvt, 'YYYY-MM')
|
||||
`);
|
||||
|
||||
console.log(`[pg-ff] CaByNomenclature: ${result.rows.length} lignes pour ${mois}/${moisN1}`);
|
||||
|
||||
Reference in new issue
Block a user