From 0bd4602568ab04e78c125efff39b081d9e7a9616 Mon Sep 17 00:00:00 2001 From: ivanm Date: Fri, 2 Feb 2024 15:50:16 +0100 Subject: [PATCH] refs #6445 remove red function and modify precedures --- db/routines/bs/procedures/comercialesCompleto.sql | 14 +++++++------- db/routines/vn2008/functions/red.sql | 14 -------------- db/versions/10866-whiteRaphis/00-firstScript.sql | 1 + 3 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 db/routines/vn2008/functions/red.sql create mode 100644 db/versions/10866-whiteRaphis/00-firstScript.sql diff --git a/db/routines/bs/procedures/comercialesCompleto.sql b/db/routines/bs/procedures/comercialesCompleto.sql index 323d5cd00..2b8019175 100644 --- a/db/routines/bs/procedures/comercialesCompleto.sql +++ b/db/routines/bs/procedures/comercialesCompleto.sql @@ -20,16 +20,16 @@ BEGIN c.movil, c.POBLACION poblacion, p.`name` provincia, - vn2008.red(f.futur) futur, + ROUND(f.futur, 2) futur, c.Credito credito, pm.`name` forma_pago, - vn2008.red(c365 / 12) consumo_medio365, - vn2008.red(c365) consumo365, - vn2008.red(CmLy.peso) peso_mes_año_pasado, - vn2008.red(CmLy.peso * 1.19) objetivo, + ROUND(c365 / 12, 2) consumo_medio365, + ROUND(c365, 2) consumo365, + ROUND(CmLy.peso, 2) peso_mes_año_pasado, + ROUND(CmLy.peso * 1.19, 2) objetivo, tr.CodigoTrabajador, - vn2008.red(mes_actual.consumo) consumoMes, - vn2008.red(IFNULL(mes_actual.consumo, 0) - IFNULL(CmLy.peso * 1.19, 0)) como_lo_llevo, + ROUND(mes_actual.consumo, 2) consumoMes, + ROUND(IFNULL(mes_actual.consumo, 0) - IFNULL(CmLy.peso * 1.19, 0), 2) como_lo_llevo, DATE(LastTicket) ultimo_ticket, dead.muerto, g.Greuge, diff --git a/db/routines/vn2008/functions/red.sql b/db/routines/vn2008/functions/red.sql deleted file mode 100644 index b94e3d716..000000000 --- a/db/routines/vn2008/functions/red.sql +++ /dev/null @@ -1,14 +0,0 @@ -DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn2008`.`red`(intCANTIDAD DOUBLE) - RETURNS double - DETERMINISTIC -BEGIN - - DECLARE n DOUBLE; - - SET n = SIGN(intCANTIDAD) * TRUNCATE( (ABS(intCANTIDAD) * 100) + 0.5001 ,0) /100 ; - - RETURN n; - -END$$ -DELIMITER ; diff --git a/db/versions/10866-whiteRaphis/00-firstScript.sql b/db/versions/10866-whiteRaphis/00-firstScript.sql new file mode 100644 index 000000000..bfbcb5dc9 --- /dev/null +++ b/db/versions/10866-whiteRaphis/00-firstScript.sql @@ -0,0 +1 @@ +REVOKE EXECUTE ON FUNCTION vn2008.red FROM hrBoss, salesPerson; -- 2.40.1