Fix calcolo plugin giacenze

This commit is contained in:
loviuz 2020-02-13 11:35:27 +01:00
parent ca48a52970
commit 30f593f7e7
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ $query = 'SELECT
FROM or_ordini
INNER JOIN or_righe_ordini ON or_ordini.id = or_righe_ordini.idordine
WHERE idarticolo = '.prepare($articolo->id)."
AND (SELECT dir FROM or_tipiordine WHERE or_tipiordine.id=or_ordini.idtipoordine) = '|direzione|'
AND (SELECT dir FROM or_tipiordine WHERE or_tipiordine.id=or_ordini.idtipoordine) = '|dir|'
AND (or_righe_ordini.qta - or_righe_ordini.qta_evasa) > 0
GROUP BY or_ordini.id
HAVING qta_ordinata > 0";