feat: Turn issues into calculated columns refs#7213
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
27e3ae897a
commit
e28a5eb478
|
@ -1,11 +1,13 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`sale_hasComponentLack`(vSelf INT)
|
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`sale_hasComponentLack`(
|
||||||
RETURNS tinyint(1)
|
vSelf INT
|
||||||
|
)RETURNS tinyint(1)
|
||||||
READS SQL DATA
|
READS SQL DATA
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Comprueba si la línea de sale tiene todos lo componentes obligatorios
|
* Check if a sales line has all the required components.
|
||||||
*
|
*
|
||||||
|
* @param vSelf Id de sale
|
||||||
* @return BOOL
|
* @return BOOL
|
||||||
*/
|
*/
|
||||||
DECLARE vHasComponentLack TINYINT(1);
|
DECLARE vHasComponentLack TINYINT(1);
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`ticket_isTooLittle`(vSelf INT)
|
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`ticket_isTooLittle`(
|
||||||
|
vSelf INT
|
||||||
|
)
|
||||||
RETURNS tinyint(1)
|
RETURNS tinyint(1)
|
||||||
READS SQL DATA
|
READS SQL DATA
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Comprueba si el ticket es pequeño en función de los parámtros de configuración
|
* Check if the ticket is small based on the volume and amount parameters.
|
||||||
* teniendo en cuenta el volumen y el importe
|
|
||||||
*
|
*
|
||||||
* @return BOOL
|
* @return BOOL
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,9 +4,9 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`buy_getRoundingProb
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de redondeo para las líneas de venta relacionadas con un buy
|
* Update the rounding problems for sales lines related to a buy.
|
||||||
*
|
*
|
||||||
* @param vSelf Id de ticket
|
* @param vSelf Id ticket
|
||||||
*/
|
*/
|
||||||
DECLARE vWarehouseFk INT;
|
DECLARE vWarehouseFk INT;
|
||||||
DECLARE vDated DATE;
|
DECLARE vDated DATE;
|
||||||
|
|
|
@ -3,9 +3,9 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_risk`(
|
||||||
vSelf INT)
|
vSelf INT)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza el riesgo de los tickets pendientes de un cliente
|
* Update the risk for a client with pending tickets
|
||||||
*
|
*
|
||||||
* @param vSelf Id del cliente
|
* @param vSelf Id cliente
|
||||||
*/
|
*/
|
||||||
DECLARE vHasDebt BOOL;
|
DECLARE vHasDebt BOOL;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_riskAll`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_riskAll`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza el riesgo todos los clientes
|
* Update the risk for all clients with pending tickets
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
DECLARE vDone BOOL;
|
DECLARE vDone BOOL;
|
||||||
|
@ -10,7 +10,7 @@ BEGIN
|
||||||
|
|
||||||
DECLARE cClients CURSOR FOR
|
DECLARE cClients CURSOR FOR
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM vn.client;
|
FROM client;
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||||||
SET vDone = TRUE;
|
SET vDone = TRUE;
|
||||||
|
@ -20,7 +20,7 @@ BEGIN
|
||||||
SET vDone = FALSE;
|
SET vDone = FALSE;
|
||||||
FETCH cClients INTO vClientFk;
|
FETCH cClients INTO vClientFk;
|
||||||
IF vDone THEN LEAVE myLoop; END IF;
|
IF vDone THEN LEAVE myLoop; END IF;
|
||||||
CALL vn.client_risk(vClientFk);
|
CALL client_risk(vClientFk);
|
||||||
END LOOP;
|
END LOOP;
|
||||||
CLOSE cClients;
|
CLOSE cClients;
|
||||||
END$$
|
END$$
|
||||||
|
|
|
@ -4,8 +4,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_getComponentLa
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas para las líneas de ventas que tienen o dejan de tener problemas
|
* Update the problems for sales lines that have or no longer have problems with components,
|
||||||
* con los componentes, verifica que esten o no todos los componenetes obligatorios
|
* verify whether all mandatory components are present or not
|
||||||
*
|
*
|
||||||
* @param vSelf Id del sale
|
* @param vSelf Id del sale
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,10 +2,9 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_getComponentLackProblemAll`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_getComponentLackProblemAll`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas para las líneas de ventas que tienen o dejan de tener problemas
|
* Update the problems for all pending sales lines that have or no longer have problems
|
||||||
* con los componentes, verifica que esten o no todos los componenetes obligatorios
|
* with components, verify whether all mandatory components are present or not
|
||||||
*
|
*
|
||||||
* @param vSelf Id del sale
|
|
||||||
*/
|
*/
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.sale
|
CREATE OR REPLACE TEMPORARY TABLE tmp.sale
|
||||||
(INDEX(saleFk))
|
(INDEX(saleFk))
|
||||||
|
|
|
@ -4,8 +4,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_getComponentLa
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas para las líneas de ventas que tienen o dejan de tener problemas
|
* Update the issues for sales lines that have or no longer have problems with components, verify
|
||||||
* con los componentes que derivan de cambios en la tabla vn.component
|
* whether all mandatory components are present or not resulting from changes in the table vn.component
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.sale
|
CREATE OR REPLACE TEMPORARY TABLE tmp.sale
|
||||||
|
|
|
@ -4,9 +4,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_getRoundingPro
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de redondeo para las líneas de venta
|
* Update the rounding problem for a sales line
|
||||||
*
|
* @param vSelf Id sale
|
||||||
* @param vSelf Id de sale
|
|
||||||
*/
|
*/
|
||||||
DECLARE vItemFk INT;
|
DECLARE vItemFk INT;
|
||||||
DECLARE vWarehouseFk INT;
|
DECLARE vWarehouseFk INT;
|
||||||
|
|
|
@ -4,8 +4,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_setProblem`(
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza en la tabla sale la columna problema
|
* Update column sale.problem with a problem code
|
||||||
* @table tmp.sale(saleFk, hasProblem) Identificadores de los sales a actualizar
|
* @table tmp.sale(saleFk, hasProblem)
|
||||||
*/
|
*/
|
||||||
UPDATE sale s
|
UPDATE sale s
|
||||||
JOIN tmp.sale ts ON ts.saleFk = s.id
|
JOIN tmp.sale ts ON ts.saleFk = s.id
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getFreezeProblem`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getFreezeProblem`()
|
||||||
proc: BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de los ticket de hoy y a fututo cuyo cliente
|
* Update the problem of tickets whose client is frozen or unfrozen
|
||||||
* se encuentra congelado o deja de estarlo
|
|
||||||
*
|
*
|
||||||
* @table tmp.ticket(ticketFk, hasProblem)
|
* @table tmp.ticket(ticketFk, hasProblem)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,8 +2,8 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getFreezeProblemAll`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getFreezeProblemAll`()
|
||||||
proc: BEGIN
|
proc: BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de los ticket de hoy y a fututo cuyo cliente
|
* Update the problem of all tickets whose client is frozen or unfrozen
|
||||||
* se encuentra congelado o deja de estarlo
|
*
|
||||||
*/
|
*/
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
||||||
(INDEX(ticketFk))
|
(INDEX(ticketFk))
|
||||||
|
|
|
@ -4,8 +4,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getFreezePro
|
||||||
)
|
)
|
||||||
proc: BEGIN
|
proc: BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de los ticket de hoy y a fututo cuyo cliente
|
* Update the problem of all client tickets whose client is frozen or unfrozen
|
||||||
* se encuentra congelado o deja de estarlo
|
* @param vClientFk Id client
|
||||||
*/
|
*/
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
||||||
(INDEX(ticketFk))
|
(INDEX(ticketFk))
|
||||||
|
|
|
@ -2,8 +2,8 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRequestProblem`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRequestProblem`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de tickets que tienen una petición de compra pendiente o
|
* Update the problems of tickets that have a pending ticketRequest or no longer have it
|
||||||
* deja de tenerla
|
*
|
||||||
* @table tmp.ticket(ticketFk, hasProblem)
|
* @table tmp.ticket(ticketFk, hasProblem)
|
||||||
*/
|
*/
|
||||||
UPDATE tmp.ticket t
|
UPDATE tmp.ticket t
|
||||||
|
|
|
@ -2,8 +2,7 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRequestProblemAll`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRequestProblemAll`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de tickets pendientes de preparar que tiene una petición
|
* Update the problems of all tickets that have a pending ticketRequest or no longer have it
|
||||||
* de compra pendiente o deja de tenerla
|
|
||||||
*/
|
*/
|
||||||
DECLARE vHasProblem BOOL;
|
DECLARE vHasProblem BOOL;
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRiskProbl
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problema de riesgo para un ticket en concreto
|
* Update the risk problem for a specific ticket
|
||||||
*
|
*
|
||||||
* @param vSelf Id del ticket
|
* @param vSelf Id ticket
|
||||||
*/
|
*/
|
||||||
DECLARE vHasRisk BOOL;
|
DECLARE vHasRisk BOOL;
|
||||||
DECLARE vHasHighRisk BOOL;
|
DECLARE vHasHighRisk BOOL;
|
||||||
|
|
|
@ -2,9 +2,8 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRiskProblemAll`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRiskProblemAll`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problema de riesgo para un ticket en concreto
|
* Update the risk problem for all tickets
|
||||||
*
|
*
|
||||||
* @param vSelf Id del ticket
|
|
||||||
*/
|
*/
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tRisk
|
CREATE OR REPLACE TEMPORARY TABLE tRisk
|
||||||
(KEY (ticketFk))
|
(KEY (ticketFk))
|
||||||
|
|
|
@ -4,7 +4,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRoundingP
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de redondeo para las líneas de venta de un ticket
|
* Update the rounding problem for the sales lines of a ticket
|
||||||
*
|
*
|
||||||
* @param vSelf Id de ticket
|
* @param vSelf Id de ticket
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTaxDataCheckedProblem`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
proc: BEGIN
|
PROCEDURE `vn`.`ticket_getTaxDataCheckedProblem`()
|
||||||
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de los ticket de hoy y a fututo
|
* Update the problem of tickets, depending on whether
|
||||||
* cuyo cliente tenga o no los datos comprobados
|
* the client taxDataCheched is verified or not
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
UPDATE tmp.ticket t
|
UPDATE tmp.ticket t
|
||||||
JOIN ticket ti ON ti.id = t.ticketFk
|
JOIN ticket ti ON ti.id = t.ticketFk
|
||||||
JOIN client c ON c.id = ti.clientFk
|
JOIN client c ON c.id = ti.clientFk
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTaxDataCheckedProblemAll`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||||
|
PROCEDURE `vn`.`ticket_getTaxDataCheckedProblemAll`()
|
||||||
proc: BEGIN
|
proc: BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de los tickets de hoy y a futuro
|
* Update the problem of all tickets, depending on whether
|
||||||
* cuyos clientes tengan o no los datos comprobados
|
* the client taxDataCheched is verified or not
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
||||||
|
|
|
@ -4,12 +4,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTaxDataCh
|
||||||
)
|
)
|
||||||
proc: BEGIN
|
proc: BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas de los ticket de hoy y a futuro
|
* Update the problem of tickets for a specific client, depending on whether
|
||||||
* cuyo cliente tenga o no los datos comprobados
|
* the client taxDataCheched is verified or not
|
||||||
*
|
*
|
||||||
* @param vClientFk Id del cliente
|
* @param vClientFk Id cliente
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
||||||
(INDEX(ticketFk))
|
(INDEX(ticketFk))
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
|
|
|
@ -4,7 +4,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTooLittle
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas cuando el ticket es demasiado pequeño o deja de serlo
|
* Update the problems when the ticket is too small or is no longer so
|
||||||
*
|
*
|
||||||
* @param vSelf Id del ticket
|
* @param vSelf Id del ticket
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,7 +2,7 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTooLittleProblemAll`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTooLittleProblemAll`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas cuando un ticket es demasiado pequeño o deja de serlo
|
* Update the problems for all tickets when the ticket is too small or is no longer so
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
||||||
|
|
|
@ -2,8 +2,8 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTooLittleProblemConfig`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTooLittleProblemConfig`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas cuando el ticket es demasiado pequeño o deja de serlo, que derivan
|
* Update the problems when the ticket is too small or is no longer so,
|
||||||
* del cambio en la tabla vn.volumeConfig
|
* derived from changes in the volumeConfig table
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
||||||
|
|
|
@ -4,8 +4,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTooLittle
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza los problemas cuando el ticket es demasiado pequeño o deja de serlo, que derivan
|
* Update the problems when the ticket is too small or is no longer so,
|
||||||
* del cambio en la tabla vn.itemCost
|
* derived from changes in the itemCost table
|
||||||
*
|
*
|
||||||
* @param vItemFk Id del item
|
* @param vItemFk Id del item
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,8 +4,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setProblem`(
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Actualiza en la tabla ticket la columna problema
|
* Update column ticket.problem with a problem code
|
||||||
* @table tmp.ticket(ticketFk, hasProblem) Identificadores de los tickets a actualizar
|
* @table tmp.ticket(ticketFk, hasProblem)
|
||||||
*/
|
*/
|
||||||
UPDATE ticket t
|
UPDATE ticket t
|
||||||
JOIN tmp.ticket tt ON tt.ticketFk = t.id
|
JOIN tmp.ticket tt ON tt.ticketFk = t.id
|
||||||
|
|
Loading…
Reference in New Issue