7383-testToMaster #2445
|
@ -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 ;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
SET vQuantity = vQuantity * vPacking;
|
THEN
|
||||||
|
SET vPacking = itemPacking(vBarcode, vWarehouseFk);
|
||||||
|
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
|
||||||
|
|
|
@ -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 ;
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE vn.productionConfig
|
||||||
|
ADD IF NOT EXISTS defaultSectorFk INT UNSIGNED DEFAULT 37 NOT NULL COMMENT 'Default sector';
|
|
@ -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');
|
||||||
|
|
Loading…
Reference in New Issue