From 438af34d73a5b85c3b0ffe8cb2f989275fc0f936 Mon Sep 17 00:00:00 2001 From: ivanm Date: Tue, 6 Feb 2024 08:40:06 +0100 Subject: [PATCH] refs #6444 cambio vUnits por vStems --- db/routines/vn/functions/intrastat_estimateNet.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/routines/vn/functions/intrastat_estimateNet.sql b/db/routines/vn/functions/intrastat_estimateNet.sql index 3ee1ca80f..350cb788a 100644 --- a/db/routines/vn/functions/intrastat_estimateNet.sql +++ b/db/routines/vn/functions/intrastat_estimateNet.sql @@ -1,7 +1,7 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`intrastat_estimateNet`( vSelf INT, - vUnits INT + vStems INT ) RETURNS double DETERMINISTIC @@ -11,12 +11,12 @@ BEGIN * datos históricos de facturas intrastat. * * @param vSelf Id de intrastat -* @param vUnits Número de unidades +* @param vStems Número de unidades * @return vNet */ DECLARE vNet DOUBLE; - SELECT ROUND(vUnits / (SUM(average) / COUNT(average)), 2) INTO vNet + SELECT ROUND(vStems / (SUM(average) / COUNT(average)), 2) INTO vNet FROM ( SELECT *, stems / net average FROM invoiceInIntrastat