feat: refs #7150 #2224
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#2224
Loading…
Reference in New Issue
No description provided.
Delete Branch "7150-greuge_dif_porte_add"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat: refs #7150to WIP: feat: refs #7150@ -1,8 +1,14 @@
DELIMITER $$
Faltan comentarios
@ -4,2 +4,2 @@
DECLARE datSTART DATETIME DEFAULT TIMESTAMPADD(DAY,-60,util.VN_CURDATE()); -- '2019-07-01'
DECLARE datEND DATETIME DEFAULT TIMESTAMPADD(DAY,-1,util.VN_CURDATE());
DECLARE vDateStarted DATETIME;
DECLARE vDateEnded DATETIME DEFAULT TIMESTAMPADD(DAY,-1,util.VN_CURDATE());
usar INTERVAL
@ -6,0 +5,4 @@
DECLARE vDateEnded DATETIME DEFAULT TIMESTAMPADD(DAY,-1,util.VN_CURDATE());
DECLARE vDaysSinceLastRecalculation INT;
SELECT daysSinceLastRecalculation INTO vDaysSinceLastRecalculation
daysSinceLastRecalculation ? el recalculo se hace diariamente, esa descripción es confusa
Podrías decirme que nombre crees que seria correcto?
@ -6,0 +8,4 @@
SELECT daysSinceLastRecalculation INTO vDaysSinceLastRecalculation
FROM vn.greugeConfig;
SET vDateStarted = TIMESTAMPADD(DAY, -vDaysSinceLastRecalculation, util.VN_CURDATE());
usar INTERVAL
@ -14,19 +20,17 @@ BEGIN
SUM((t.zonePrice - t.zoneBonus) * ebv.ratio) AS teorico,
00000.00 as practico,
Alias 'AS' no son necesarios
@ -21,1 +23,4 @@
t.clientFk,
t.shipped
FROM vn.ticket t
JOIN vn2008.Clientes cli ON cli.Id_cliente = t.clientFk
eliminar las dependencias de vn2008
@ -29,1 +30,3 @@
AND z.isVolumetric = FALSE
WHERE t.shipped between vDateStarted AND vDateEnded
AND cli.`real`
AND t.companyFk IN (442 , 567)
Sin números
@ -30,0 +30,4 @@
WHERE t.shipped between vDateStarted AND vDateEnded
AND cli.`real`
AND t.companyFk IN (442 , 567)
AND z.isVolumetric = FALSE
NOT
@ -49,11 +53,11 @@ BEGIN
(PRIMARY KEY (ticketFk))
ENGINE = MEMORY
SELECT dp.ticketFk, sum(Cantidad * Valor) as valor
SUM mayúsculas
@ -55,2 +56,2 @@
WHERE mc.Id_Componente = 15
GROUP BY dp.ticketFk;
FROM tmp.dp
JOIN vn2008.Movimientos m ON m.Id_Ticket = dp.ticketFk
vn2008 ¿?
@ -57,0 +56,4 @@
FROM tmp.dp
JOIN vn2008.Movimientos m ON m.Id_Ticket = dp.ticketFk
JOIN vn2008.Movimientos_componentes mc using(Id_Movimiento)
WHERE mc.Id_Componente = 15
Si estamos refactorizando no deben de aparecer números, JOIN al código de componente correspondiente
@ -82,2 +82,2 @@
, 1
,dp.ticketFk
SELECT dp.clientFk,
concat('dif_porte ', dp.ticketFk),
funciones en mayúsculas
WIP: feat: refs #7150to feat: refs #7150