From 3fa7eb1d2aa03ca39289bb9836f5b997c0de0ca5 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Fri, 21 Jun 2024 13:01:19 +0200 Subject: [PATCH] feat itemShelving_filterBuyer refs #7023 --- db/routines/vn/procedures/itemShelving_filterBuyer.sql | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/db/routines/vn/procedures/itemShelving_filterBuyer.sql b/db/routines/vn/procedures/itemShelving_filterBuyer.sql index 894a14464..2fdf21ee1 100644 --- a/db/routines/vn/procedures/itemShelving_filterBuyer.sql +++ b/db/routines/vn/procedures/itemShelving_filterBuyer.sql @@ -15,13 +15,14 @@ proc:BEGIN SELECT * FROM (SELECT sub.itemFk, sub.longName, - CONCAT('Hoy quedan por sacar ', CAST(sub2.pendiente AS DECIMAL(10,0)), ' unidades.') `size`, + CONCAT('Hoy saldrán ', CAST(sub2.pendiente AS DECIMAL(10,0)), ' unidades.') `size`, CONCAT(IF(sub2.itemFk, IF(sub2.pendiente > (sub.upstairs + sub.downstairs),'(1) ','(2) '),'(3) ' ),sub.producer) producer, sub.upstairs, sub.downstairs, sub.visible, CAST(visible - upstairs - downstairs AS DECIMAL(10,0)) nicho, - sub.name itemColour + sub.name itemColour, + CAST(sub2.pendiente AS DECIMAL(10,0)) pendingAmount FROM (SELECT iss.itemFk, CONCAT(i.longName, ' ', IFNULL(i.size, ''),' ', IFNULL(i.subName, '') ) longName, '' size, @@ -52,13 +53,14 @@ proc:BEGIN UNION ALL SELECT v.item_id, i.longName, - CONCAT('Hoy quedan por sacar ', CAST(sub5.pendiente AS DECIMAL(10,0)), ' unidades.') `size`, + CONCAT('Hoy saldrán ', CAST(sub5.pendiente AS DECIMAL(10,0)), ' unidades.') `size`, CONCAT(IF(sub5.pendiente,'(0) ','(3) ')) producer, 0, 0, v.visible, v.visible nicho, - ik.name itemColour + ik.name itemColour, + CAST(sub5.pendiente AS DECIMAL(10,0) pendingAmount FROM cache.visible v JOIN item i ON i.id = v.item_id LEFT JOIN ink ik ON ik.id = i.inkFk