From 2f7f2374224f58d3c1e87b1f256abf63c749ea7f Mon Sep 17 00:00:00 2001 From: sergiodt Date: Mon, 8 Apr 2024 13:28:38 +0200 Subject: [PATCH] refs #6574 feat: add order --- db/routines/vn/procedures/item_getBalance.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/item_getBalance.sql b/db/routines/vn/procedures/item_getBalance.sql index e7a3641e0..11af7e570 100644 --- a/db/routines/vn/procedures/item_getBalance.sql +++ b/db/routines/vn/procedures/item_getBalance.sql @@ -155,7 +155,7 @@ BEGIN SET @currentLineFk := 0; SET @shipped := ''; - SELECT DATE(@shipped:= shipped) shipped, + SELECT DATE(@shipped:= t.shipped) shipped, t.alertLevel, t.stateName, t.origin, @@ -166,7 +166,7 @@ BEGIN t.`out`, @a := @a + IFNULL(t.`in`, 0) - IFNULL(t.`out`, 0) balance, @currentLineFk := IF (@shipped < util.VN_CURDATE() - OR (@shipped = util.VN_CURDATE() AND (isPicked OR a.`code` >= 'ON_PREPARATION')), + OR (@shipped = util.VN_CURDATE() AND (t.isPicked OR a.`code` >= 'ON_PREPARATION')), t.lineFk, @currentLineFk) lastPreparedLineFk, t.isTicket,