feat: refs #6777 change dependecies vn2008 to vn #2000

Merged
robert merged 32 commits from 6777-changeDependenciesVn2008toVnPart7 into dev 2024-04-22 10:20:51 +00:00
1 changed files with 15 additions and 18 deletions
Showing only changes of commit 3500886149 - Show all commits

View File

@ -15,31 +15,31 @@ BEGIN
hour(t.shipped) as Hora,
hour(t.shipped) as Departure,
t.id,
m.Id_Movimiento,
m.Id_Movimiento,
m.Cantidad,
m.Concepte,
ABS(m.Reservado) Reservado,
ABS(m.Reservado) Reservado,
i.Categoria,
tp.Tipo,
tp.Tipo,
t.nickname as Cliente,
wh.name as Almacen,
t.warehouseFk,
cs.province_id,
a.agency_id,
ct.description as Taller,
stock.visible,
stock.available
ct.description as Taller,
stock.visible,
stock.available
FROM vn.ticket t
JOIN vn2008.Agencias a ON a.Id_Agencia = t.agencyModeFk
JOIN vn.warehouse wh ON wh.id = t.warehouseFk
JOIN vn2008.Movimientos m ON m.Id_Ticket = t.id
JOIN vn2008.Articles i ON i.Id_Article = m.Id_Article
JOIN vn2008.Articles i ON i.Id_Article = m.Id_Article
JOIN vn2008.Tipos tp ON tp.tipo_id = i.tipo_id
JOIN vn.confectionType ct ON ct.id = tp.confeccion
JOIN vn.confectionType ct ON ct.id = tp.confeccion
JOIN vn2008.Consignatarios cs on cs.Id_Consigna = t.addressFk
LEFT JOIN vn.ticketState tls on tls.ticketFk = t.id
LEFT JOIN
(
LEFT JOIN
(
SELECT item_id, sum(visible) visible, sum(available) available
FROM
(
@ -57,12 +57,12 @@ BEGIN
where cc.cache_id IN (2,8) and cc.params IN ("1","44")
) sub
GROUP BY item_id
) stock ON stock.item_id = m.Id_Article
) stock ON stock.item_id = m.Id_Article
WHERE tp.confeccion
AND tls.alertLevel < maxAlertLevel
AND wh.hasConfectionTeam
AND t.shipped BETWEEN vDated AND vEndingDate
AND m.Cantidad > 0;
AND m.Cantidad > 0;
-- Entradas
@ -74,9 +74,9 @@ BEGIN
Categoria,
Cliente,
Almacen,
Taller
Taller
)
SELECT
SELECT
tr.shipment AS Fecha,
e.Id_Entrada AS Id_Ticket,
c.Cantidad,
@ -96,10 +96,7 @@ BEGIN
WHERE who.hasConfectionTeam
AND tp.confeccion
AND tr.shipment BETWEEN vDated AND vEndingDate;
SELECT * FROM tmp.production_buffer;
SELECT * FROM tmp.production_buffer;
END$$
DELIMITER ;