refs #6574 feat: add order
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Sergio De la torre 2024-04-08 11:35:10 +02:00
parent 957b0c71ca
commit 42b033dde2
1 changed files with 19 additions and 19 deletions

View File

@ -156,27 +156,27 @@ BEGIN
SET @shipped := ''; SET @shipped := '';
SELECT DATE(@shipped:= shipped) shipped, SELECT DATE(@shipped:= shipped) shipped,
alertLevel, t.alertLevel,
stateName, t.stateName,
origin, t.origin,
reference, t.reference,
clientFk, t.clientFk,
name, t.name,
`in` invalue, t.`in` invalue,
`out`, t.`out`,
@a := @a + IFNULL(`in`, 0) - IFNULL(`out`, 0) balance, @a := @a + IFNULL(t.`in`, 0) - IFNULL(t.`out`, 0) balance,
@currentLineFk := IF (@shipped < util.VN_CURDATE() @currentLineFk := IF (@shipped < util.VN_CURDATE()
OR (@shipped = util.VN_CURDATE() AND (isPicked OR a.`code` >= 'ON_PREPARATION')), OR (@shipped = util.VN_CURDATE() AND (isPicked OR a.`code` >= 'ON_PREPARATION')),
lineFk, t.lineFk,
@currentLineFk) lastPreparedLineFk, @currentLineFk) lastPreparedLineFk,
isTicket, t.isTicket,
lineFk, t.lineFk,
isPicked, t.isPicked,
clientType, t.clientType,
claimFk, t.claimFk,
`order` t.`order`
FROM tItemDiary FROM tItemDiary t
LEFT JOIN alertLevel a ON a.id = tItemDiary.alertLevel; LEFT JOIN alertLevel a ON a.id = t.alertLevel;
ELSE ELSE
SELECT SUM(`in`) - SUM(`out`) INTO @a SELECT SUM(`in`) - SUM(`out`) INTO @a
@ -199,7 +199,7 @@ BEGIN
0 isPicked, 0 isPicked,
0 clientType, 0 clientType,
0 claimFk, 0 claimFk,
`order` NULL `order`
UNION ALL UNION ALL
SELECT shipped, SELECT shipped,
alertlevel, alertlevel,