refs #6444 cambio vUnits por vStems
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Ivan Mas 2024-02-06 08:40:06 +01:00
parent 1a869766b9
commit 438af34d73
1 changed files with 3 additions and 3 deletions

View File

@ -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