Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-08-08 10:07:26 +02:00
commit 17d05ecfe2
3 changed files with 6 additions and 5 deletions

View File

@ -67,7 +67,9 @@ module.exports = Self => {
if (vnUser.twoFactor === 'email') { if (vnUser.twoFactor === 'email') {
const $ = Self.app.models; const $ = Self.app.models;
const code = String(Math.floor(Math.random() * 999999)); const min = 100000;
const max = 999999;
const code = String(Math.floor(Math.random() * (max - min + 1)) + min);
const maxTTL = ((60 * 1000) * 5); // 5 min const maxTTL = ((60 * 1000) * 5); // 5 min
await $.AuthCode.upsertWithWhere({userFk: vnUser.id}, { await $.AuthCode.upsertWithWhere({userFk: vnUser.id}, {
userFk: vnUser.id, userFk: vnUser.id,

View File

@ -1,8 +1,8 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_updateCoordinates`( CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_updateCoordinates`(
vTicketFk INT, vTicketFk INT,
vLongitude INT, vLongitude DECIMAL(11,7),
vLatitude INT) vLatitude DECIMAL(11,7))
BEGIN BEGIN
/** /**
* Actualiza las coordenadas de una dirección. * Actualiza las coordenadas de una dirección.

View File

@ -15,7 +15,7 @@ BEGIN
DECLARE cur CURSOR FOR DECLARE cur CURSOR FOR
SELECT bb.id buyFk, SELECT bb.id buyFk,
FLOOR(ish.visible / ish.packing) ishStickers, LEAST(bb.stickers, FLOOR(ish.visible / ish.packing)) ishStickers,
bb.stickers buyStickers bb.stickers buyStickers
FROM itemShelving ish FROM itemShelving ish
JOIN (SELECT b.id, b.itemFk, b.stickers JOIN (SELECT b.id, b.itemFk, b.stickers
@ -23,7 +23,6 @@ BEGIN
WHERE b.entryFk = vFromEntryFk WHERE b.entryFk = vFromEntryFk
ORDER BY b.stickers DESC ORDER BY b.stickers DESC
LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk
AND bb.stickers >= FLOOR(ish.visible / ish.packing)
WHERE ish.shelvingFk = vShelvingFk COLLATE utf8_general_ci WHERE ish.shelvingFk = vShelvingFk COLLATE utf8_general_ci
AND NOT ish.isSplit AND NOT ish.isSplit
GROUP BY ish.id; GROUP BY ish.id;