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

This commit is contained in:
Alex Moreno 2024-05-13 14:24:31 +02:00
commit 6251493adb
6 changed files with 21 additions and 12 deletions

View File

@ -7,15 +7,19 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`clientsDisable`
DO BEGIN DO BEGIN
UPDATE account.user u UPDATE account.user u
JOIN client c ON c.id = u.id JOIN client c ON c.id = u.id
LEFT JOIN account.account a ON a.id = u.id
SET u.active = FALSE SET u.active = FALSE
WHERE c.typeFk = 'normal' WHERE c.typeFk = 'normal'
AND a.id IS NULL
AND u.active
AND c.created < util.VN_CURDATE() - INTERVAL 12 MONTH
AND u.id NOT IN ( AND u.id NOT IN (
SELECT DISTINCT c.id SELECT DISTINCT c.id
FROM client c FROM client c
LEFT JOIN ticket t ON t.clientFk = c.id LEFT JOIN ticket t ON t.clientFk = c.id
WHERE c.salesPersonFk IS NOT NULL WHERE c.salesPersonFk IS NOT NULL
OR t.created > util.VN_CURDATE() - INTERVAL 2 MONTH OR t.created > util.VN_CURDATE() - INTERVAL 12 MONTH
OR shipped > util.VN_CURDATE() - INTERVAL 2 MONTH OR shipped > util.VN_CURDATE() - INTERVAL 12 MONTH
); );
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -30,7 +30,10 @@ BEGIN
-- Si hay colecciones sin terminar, sale del proceso -- Si hay colecciones sin terminar, sale del proceso
CALL collection_get(vUserFk); CALL collection_get(vUserFk);
SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0 INTO vHasTooMuchCollections SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0,
collection_assign_lockname
INTO vHasTooMuchCollections,
vLockName
FROM productionConfig pc FROM productionConfig pc
LEFT JOIN tCollection ON TRUE; LEFT JOIN tCollection ON TRUE;

View File

@ -20,8 +20,11 @@ BEGIN
SELECT barcodeToItem(vBarcode) INTO vItemFk; SELECT barcodeToItem(vBarcode) INTO vItemFk;
SET vPacking = COALESCE(vPacking, GREATEST(vn.itemPacking(vBarcode,vWarehouseFk), 1)); IF vPacking IS NULL
THEN
SET vPacking = itemPacking(vBarcode, vWarehouseFk);
SET vQuantity = vQuantity * vPacking; SET vQuantity = vQuantity * vPacking;
END IF;
IF (SELECT COUNT(*) FROM itemShelving IF (SELECT COUNT(*) FROM itemShelving
WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk WHERE shelvingFk COLLATE utf8_unicode_ci = vShelvingFk

View File

@ -10,11 +10,5 @@ BEGIN
UPDATE `address` SET isDefaultAddress = TRUE UPDATE `address` SET isDefaultAddress = TRUE
WHERE id = NEW.defaultAddressFk; WHERE id = NEW.defaultAddressFk;
END IF; END IF;
IF NOT NEW.isActive THEN
UPDATE account.`user`
SET active = FALSE
WHERE id = NEW.id;
END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -0,0 +1,4 @@
ALTER TABLE vn.productionConfig
ADD IF NOT EXISTS defaultSectorFk INT UNSIGNED DEFAULT 37 NOT NULL COMMENT 'Default sector';

View File

@ -29,7 +29,8 @@ module.exports = Self => {
http: { http: {
path: '/:id/invoice-in-pdf', path: '/:id/invoice-in-pdf',
verb: 'GET' verb: 'GET'
} },
accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.invoiceInPdf = (ctx, id) => Self.printReport(ctx, id, 'invoiceIn'); Self.invoiceInPdf = (ctx, id) => Self.printReport(ctx, id, 'invoiceIn');