7213-Pasar-problemas-a-columnas-calculadas #2396

Merged
carlosap merged 15 commits from 7213-Pasar-problemas-a-columnas-calculadas into dev 2024-05-14 09:35:52 +00:00
Member
No description provided.
carlosap added 8 commits 2024-05-02 16:29:00 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
d53f19b47d
feat: Turn problems into calculated columns
gitea/salix/pipeline/pr-dev This commit looks good Details
7bbf113ffa
feat: Turn issues into calculated columns refs#7213
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
c262805d33
feat: Turn issues into calculated columns refs#7213
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
9ca1b9f104
feat: Turn issues into calculated columns refs#7213
gitea/salix/pipeline/pr-dev This commit looks good Details
27e3ae897a
feat: Turn issues into calculated columns refs#7213
gitea/salix/pipeline/pr-dev This commit looks good Details
e28a5eb478
feat: Turn issues into calculated columns refs#7213
carlosap requested review from jgallego 2024-05-02 16:29:14 +00:00
jgallego requested changes 2024-05-03 06:21:41 +00:00
Dismissed
@ -0,0 +15,4 @@
SELECT (SUM(IFNULL(sv.litros, 0)) < vc.minTicketVolume
OR IFNULL(t.totalWithoutVat, 0) < vc.minTicketValue) INTO vIsTooLittle
FROM ticket t
LEFT JOIN sale s ON s.ticketFk = t.id
Owner

la taula sale no es gasta, pots llevarla

la taula sale no es gasta, pots llevarla
carlosap marked this conversation as resolved
@ -0,0 +6,4 @@
/**
* Update the rounding problems for sales lines related to a buy.
*
* @param vSelf Id ticket
Owner

si el proc es diu buy_ sSelf no pot ser un ticket

si el proc es diu buy_ sSelf no pot ser un ticket
Author
Member

Elimine el proc, no el gastaré

Elimine el proc, no el gastaré
carlosap marked this conversation as resolved
@ -0,0 +11,4 @@
DECLARE vWarehouseFk INT;
DECLARE vDated DATE;
SELECT warehouseFk, DATE(shipped)
Owner

si vDated es tipo DATE, et pots ahorrar la funcion DATE(shipped)

si vDated es tipo DATE, et pots ahorrar la funcion DATE(shipped)
carlosap marked this conversation as resolved
@ -0,0 +1,82 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_risk`(
Owner

en este proc no has gastat el mateix patró de noms que en la resta de procediments

en este proc no has gastat el mateix patró de noms que en la resta de procediments
Author
Member

Este es un proc adicional que actualitza un camp cache de ticket que és el que es gastarà per a calcular el problema del riesgo

Este es un proc adicional que actualitza un camp cache de ticket que és el que es gastarà per a calcular el problema del riesgo
carlosap marked this conversation as resolved
@ -0,0 +74,4 @@
UPDATE ticket t
JOIN tTicketRisk tr ON tr.ticketFk = t.id
SET t.risk = tr.amount;
Owner

no cal actualizar tb el camp problem?

no cal actualizar tb el camp problem?
carlosap marked this conversation as resolved
@ -0,0 +76,4 @@
JOIN tTicketRisk tr ON tr.ticketFk = t.id
SET t.risk = tr.amount;
DROP TEMPORARY TABLE IF EXISTS tTicketRisk;
Owner

if exist no es posa

if exist no es posa
carlosap marked this conversation as resolved
@ -0,0 +16,4 @@
JOIN sale s ON s.ticketFk = t.id
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
WHERE t.shipped >= util.midnight()
AND sc.componentFk = vComponentFk;
Owner

es codi repetit, fusional en el de dalt, si li pases vComponentFk fas una cosa y si pases NULL ho mira per a tots.

es codi repetit, fusional en el de dalt, si li pases vComponentFk fas una cosa y si pases NULL ho mira per a tots.
carlosap marked this conversation as resolved
@ -0,0 +9,4 @@
*/
DECLARE vItemFk INT;
DECLARE vWarehouseFk INT;
DECLARE vDated DATE;
Owner

vShipped es mes concret

vShipped es mes concret
carlosap marked this conversation as resolved
@ -0,0 +12,4 @@
DECLARE vDated DATE;
DECLARE vQuantity INT;
SELECT s.itemFk, t.warehouseFk, DATE(t.shipped), s.quantity
Owner

no cal DATE(

no cal DATE(
carlosap marked this conversation as resolved
@ -0,0 +12,4 @@
SET s.problem = CONCAT(
IF(ts.hasProblem,
CONCAT(s.problem, ',', vProblemCode),
REPLACE(s.problem, vProblemCode , '')));
Owner

explicam el objectiu d'esta linea

explicam el objectiu d'esta linea
Author
Member

Està validat per Juan, de moment no em trobat manera de fer-ho diferent, marca o desmarca un valor de un camp SET

Està validat per Juan, de moment no em trobat manera de fer-ho diferent, marca o desmarca un valor de un camp SET
carlosap marked this conversation as resolved
@ -0,0 +4,4 @@
/**
* Update the problems of all tickets that have a pending ticketRequest or no longer have it
*/
DECLARE vHasProblem BOOL;
Owner

no es gasta esta variable

no es gasta esta variable
jgallego marked this conversation as resolved
@ -0,0 +8,4 @@
* deja de tenerla
* @param vSelf Id del ticket de la petición de compra
*/
DECLARE vHasProblem BOOL;
Owner

no es gasta

no es gasta
carlosap marked this conversation as resolved
@ -0,0 +9,4 @@
*/
UPDATE tmp.ticket t
JOIN ticket ti ON ti.id = t.ticketFk
JOIN client c ON c.id = ti.clientFk
Owner

si actualices y despues la borres no val per a res, deuries actualizar la taula ticket en este cas ti

si actualices y despues la borres no val per a res, deuries actualizar la taula ticket en este cas ti
carlosap marked this conversation as resolved
@ -0,0 +10,4 @@
UPDATE tmp.ticket t
JOIN ticket ti ON ti.id = t.ticketFk
JOIN client c ON c.id = ti.clientFk
SET t.hasproblem = TRUE
Owner

esta condicio deu ser al revés, es un problema quan no te el datos comprovats

esta condicio deu ser al revés, es un problema quan no te el datos comprovats
carlosap marked this conversation as resolved
@ -0,0 +1,20 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTooLittleProblemConfig`()
Owner

db/routines/vn/procedures/ticket_getTooLittleProblemConfig.sql
y
db/routines/vn/procedures/ticket_getTooLittleProblemAll.sql
son igual llevem un?

db/routines/vn/procedures/ticket_getTooLittleProblemConfig.sql y db/routines/vn/procedures/ticket_getTooLittleProblemAll.sql son igual llevem un?
Author
Member

Gastarem només la de ticket_getTooLittleProblemConfig.sql

Gastarem només la de ticket_getTooLittleProblemConfig.sql
carlosap marked this conversation as resolved
carlosap added 1 commit 2024-05-03 08:19:09 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
7659a39b42
feat: Turn issues into calculated columns refs#7213
carlosap requested review from jgallego 2024-05-03 08:19:37 +00:00
jgallego requested changes 2024-05-03 11:11:21 +00:00
Dismissed
@ -0,0 +1,82 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_risk`(
vSelf INT)
Owner

ticket_setRisk seria realment lo que fa

ticket_setRisk seria realment lo que fa
carlosap marked this conversation as resolved
@ -0,0 +29,4 @@
), dated AS(
SELECT MIN(DATE(t.dated) - INTERVAL cc.riskScope MONTH) started,
MAX(DATE(t.dated)) ended
FROM ticket t
Owner

aci no poses cap filtro?

aci no poses cap filtro?
Author
Member

No de fet el procediment es per a inicialitzar les dades i en cas de emergencia tindre que recalcular-ho tot

No de fet el procediment es per a inicialitzar les dades i en cas de emergencia tindre que recalcular-ho tot
jgallego marked this conversation as resolved
@ -0,0 +1,26 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_getComponentLackProblemComponent`(
Owner

realment no es un get..seria mes un sale_setComponentLackProblemComponent

realment no es un get..seria mes un sale_setComponentLackProblemComponent
carlosap marked this conversation as resolved
@ -0,0 +1,34 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_getRoundingProblem`(
Owner

set

set
carlosap marked this conversation as resolved
@ -0,0 +1,18 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRequestProblemAll`()
Owner

set

set
carlosap marked this conversation as resolved
@ -0,0 +11,4 @@
DECLARE vWarehouseFk INT;
DECLARE vDated DATE;
SELECT warehouseFk, DATE(shipped)
Owner

sense DATE

sense DATE
carlosap marked this conversation as resolved
carlosap added 1 commit 2024-05-03 12:03:30 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
2659e3b259
feat: Turn issues into calculated columns refs#7213
carlosap requested review from jgallego 2024-05-03 12:46:24 +00:00
jgallego requested changes 2024-05-03 14:11:24 +00:00
Dismissed
@ -0,0 +1,82 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_setRisk`(
Owner

el nom deu ser ticket_setRisk perque no s'actualiza client

el nom deu ser ticket_setRisk perque no s'actualiza client
carlosap marked this conversation as resolved
@ -0,0 +20,4 @@
SET vDone = FALSE;
FETCH cClients INTO vClientFk;
IF vDone THEN LEAVE myLoop; END IF;
CALL client_setRisk(vClientFk);
Owner

ticket_setRisk

ticket_setRisk
carlosap marked this conversation as resolved
@ -0,0 +12,4 @@
FROM ticket t
WHERE t.shipped >= util.midnight();
CALL ticket_getFreezeProblem();
Owner

ticket_setFreezeProblem

ticket_setFreezeProblem
carlosap marked this conversation as resolved
@ -0,0 +1,22 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setFreezeProblemByClient`(
Owner

lo mateix que en el anterior, pasali el vClientFk, si es null tots sino ixe, i no repetim codi

lo mateix que en el anterior, pasali el vClientFk, si es null tots sino ixe, i no repetim codi
carlosap marked this conversation as resolved
@ -0,0 +15,4 @@
WHERE t.clientFk = vClientFk
AND t.shipped >= util.midnight();
CALL ticket_getFreezeProblem();
Owner

ticket_setFreezeProblem

ticket_setFreezeProblem
carlosap marked this conversation as resolved
@ -0,0 +1,22 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setRequestProblemByTicket`(
Owner

fusionar amb ticket_setRequestProblemAll
, així creem menys procs

fusionar amb ticket_setRequestProblemAll , així creem menys procs
carlosap marked this conversation as resolved
@ -0,0 +1,39 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setRiskProblemAll`()
Owner

ja posats, faria el mateix..borraria tots els all y by client i els faria ticket_setRiskProblem

ja posats, faria el mateix..borraria tots els all y by client i els faria ticket_setRiskProblem
carlosap marked this conversation as resolved
jgallego requested changes 2024-05-10 14:01:12 +00:00
Dismissed
@ -0,0 +1,18 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost`
PROCEDURE `vn`.`ticket_setTaxDataCheckedProblem`()
Owner

ticket_setProblemTaxDataChecked

ticket_setProblemTaxDataChecked
carlosap marked this conversation as resolved
@ -0,0 +10,4 @@
UPDATE tmp.ticket t
JOIN ticket ti ON ti.id = t.ticketFk
JOIN client c ON c.id = ti.clientFk
SET ti.hasproblem = TRUE
Owner

t.hasproblem = TRUE

t.hasproblem = TRUE
carlosap marked this conversation as resolved
carlosap added 1 commit 2024-05-13 07:54:29 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
6d3f00ec95
feat: Turn issues into calculated columns refs#7213
carlosap added 1 commit 2024-05-13 08:06:34 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
057121582e
feat: Turn issues into calculated columns refs#7213
carlosap added 1 commit 2024-05-13 10:32:50 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
b1af625937
feat: Turn issues into calculated columns refs#7213
carlosap added 1 commit 2024-05-13 11:32:00 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
f89ca786df
eat: Turn issues into calculated columns refs#7213
carlosap requested review from jgallego 2024-05-13 11:32:31 +00:00
jgallego requested changes 2024-05-13 11:53:47 +00:00
Dismissed
@ -0,0 +16,4 @@
FROM ticket t
WHERE t.shipped >= util.midnight()
AND (vSelf IS NULL OR t.id = vSelf);
Owner

dos bots de linea

dos bots de linea
carlosap marked this conversation as resolved
@ -0,0 +1,34 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setProblemRounding`(
Owner

sols per confirmar, ja hiha un sale_setProblemRounding fa falta 2? ticket i sale?

sols per confirmar, ja hiha un sale_setProblemRounding fa falta 2? ticket i sale?
Author
Member

Sí, es dispara desde sale y desde ticket

Sí, es dispara desde sale y desde ticket
carlosap marked this conversation as resolved
@ -0,0 +15,4 @@
FROM ticket t
JOIN client c ON c.id = t.clientFk
WHERE t.shipped >= util.midnight()
AND (c.id = vClientFk OR vClientFk IS NULL);
Owner

esta variabla no esta declarada

esta variabla no esta declarada
carlosap marked this conversation as resolved
@ -0,0 +17,4 @@
FROM vn.ticket t
JOIN vn.sale s ON s.ticketFk = t.id
WHERE t.shipped >= util.midnight()
AND (s.itemFk = vItemFk OR vItemFk IS NULL)
Owner

2 espais

2 espais
carlosap marked this conversation as resolved
carlosap added 1 commit 2024-05-13 12:21:05 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
3ce43909e2
feat: Turn issues into calculated columns refs#7213
carlosap requested review from jgallego 2024-05-13 13:28:34 +00:00
jgallego approved these changes 2024-05-13 18:27:17 +00:00
carlosap merged commit 4254fac6c2 into dev 2024-05-14 09:35:52 +00:00
carlosap deleted branch 7213-Pasar-problemas-a-columnas-calculadas 2024-05-14 09:35:53 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix#2396
No description provided.