7691-testToMaster #2703

Merged
alexm merged 268 commits from 7691-testToMaster into master 2024-07-09 05:38:28 +00:00
5 changed files with 45 additions and 31 deletions
Showing only changes of commit 74b71079f2 - Show all commits

View File

@ -60,7 +60,7 @@ module.exports = Self => {
if (print) await Self.rawSql('CALL vn.collection_printSticker(?,NULL)', [id], myOptions); if (print) await Self.rawSql('CALL vn.collection_printSticker(?,NULL)', [id], myOptions);
for (let ticket of tickets) { for (let ticket of tickets) {
let observations = ticket.observation.split(' '); let observations = ticket.observaciones.split(' ');
for (let observation of observations) { for (let observation of observations) {
const salesPerson = ticket.salesPersonFk; const salesPerson = ticket.salesPersonFk;

View File

@ -26,8 +26,8 @@ describe('collection getTickets()', () => {
expect(collectionTickets.tickets[1].ticketFk).toEqual(2); expect(collectionTickets.tickets[1].ticketFk).toEqual(2);
expect(collectionTickets.tickets[2].ticketFk).toEqual(23); expect(collectionTickets.tickets[2].ticketFk).toEqual(23);
expect(collectionTickets.tickets[0].sales[0].ticketFk).toEqual(1); expect(collectionTickets.tickets[0].sales[0].ticketFk).toEqual(1);
expect(collectionTickets.tickets[0].sales[1].ticketFk).toEqual(1); expect(collectionTickets.tickets[1].sales.length).toEqual(0);
expect(collectionTickets.tickets[0].sales[2].ticketFk).toEqual(1); expect(collectionTickets.tickets[2].sales.length).toEqual(0);
expect(collectionTickets.tickets[0].sales[0].Barcodes.length).toBeTruthy(); expect(collectionTickets.tickets[0].sales[0].Barcodes.length).toBeTruthy();
await tx.rollback(); await tx.rollback();

View File

@ -19,9 +19,9 @@ BEGIN
WITH observation AS ( WITH observation AS (
SELECT tob.ticketFk, tob.description SELECT tob.ticketFk, tob.description
FROM ticketObservation tob FROM vn.ticketObservation tob
JOIN ticketCollection tc ON tc.ticketFk = tob.ticketFk JOIN vn.ticketCollection tc ON tc.ticketFk = tob.ticketFk
LEFT JOIN observationType ot ON ot.id = tob.observationTypeFk LEFT JOIN vn.observationType ot ON ot.id = tob.observationTypeFk
WHERE ot.`code` = 'itemPicker' WHERE ot.`code` = 'itemPicker'
AND tc.collectionFk = vParamFk AND tc.collectionFk = vParamFk
) )
@ -30,19 +30,19 @@ BEGIN
am.name agencyName, am.name agencyName,
t.warehouseFk, t.warehouseFk,
w.id salesPersonFk, w.id salesPersonFk,
IFNULL(ob.description,'') observation, IFNULL(ob.description,'') observaciones,
cc.rgb cc.rgb
FROM ticket t FROM vn.ticket t
LEFT JOIN ticketCollection tc ON t.id = tc.ticketFk LEFT JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
LEFT JOIN collection c2 ON c2.id = tc.collectionFk LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk
LEFT JOIN collectionColors cc LEFT JOIN vn.collectionColors cc
ON cc.wagon = tc.wagon ON cc.wagon = tc.wagon
AND cc.shelve = tc.`level` AND cc.shelve = tc.`level`
AND cc.trainFk = c2.trainFk AND cc.trainFk = c2.trainFk
LEFT JOIN zone z ON z.id = t.zoneFk LEFT JOIN vn.zone z ON z.id = t.zoneFk
LEFT JOIN agencyMode am ON am.id = z.agencyModeFk LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
LEFT JOIN client c ON c.id = t.clientFk LEFT JOIN vn.client c ON c.id = t.clientFk
LEFT JOIN worker w ON w.id = c.salesPersonFk LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
LEFT JOIN observation ob ON ob.ticketFk = t.id LEFT JOIN observation ob ON ob.ticketFk = t.id
WHERE t.id = vParamFk WHERE t.id = vParamFk
AND t.shipped >= vDated AND t.shipped >= vDated
@ -54,17 +54,17 @@ BEGIN
w.id salesPersonFk, w.id salesPersonFk,
ob.description, ob.description,
IF(NOT (vItemPackingTypeFk <=> 'V'), cc.rgb, NULL) `rgb` IF(NOT (vItemPackingTypeFk <=> 'V'), cc.rgb, NULL) `rgb`
FROM ticket t FROM vn.ticket t
JOIN ticketCollection tc ON t.id = tc.ticketFk JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
LEFT JOIN collection c2 ON c2.id = tc.collectionFk LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk
LEFT JOIN collectionColors cc LEFT JOIN vn.collectionColors cc
ON cc.wagon = tc.wagon ON cc.wagon = tc.wagon
AND cc.shelve = tc.`level` AND cc.shelve = tc.`level`
AND cc.trainFk = c2.trainFk AND cc.trainFk = c2.trainFk
LEFT JOIN zone z ON z.id = t.zoneFk LEFT JOIN vn.zone z ON z.id = t.zoneFk
LEFT JOIN agencyMode am ON am.id = z.agencyModeFk LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
LEFT JOIN client c ON c.id = t.clientFk LEFT JOIN vn.client c ON c.id = t.clientFk
LEFT JOIN worker w ON w.id = c.salesPersonFk LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
LEFT JOIN observation ob ON ob.ticketFk = t.id LEFT JOIN observation ob ON ob.ticketFk = t.id
WHERE tc.collectionFk = vParamFk WHERE tc.collectionFk = vParamFk
UNION ALL UNION ALL
@ -75,14 +75,14 @@ BEGIN
c.salesPersonFk, c.salesPersonFk,
ob.description, ob.description,
NULL `rgb` NULL `rgb`
FROM sectorCollection sc FROM vn.sectorCollection sc
JOIN sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id JOIN vn.sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id
JOIN saleGroup sg ON sg.id = ss.saleGroupFk JOIN vn.saleGroup sg ON sg.id = ss.saleGroupFk
JOIN ticket t ON t.id = sg.ticketFk JOIN vn.ticket t ON t.id = sg.ticketFk
LEFT JOIN zone z ON z.id = t.zoneFk LEFT JOIN vn.zone z ON z.id = t.zoneFk
LEFT JOIN agencyMode am ON am.id = z.agencyModeFk LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
LEFT JOIN observation ob ON ob.ticketFk = t.id LEFT JOIN observation ob ON ob.ticketFk = t.id
LEFT JOIN client c ON c.id = t.clientFk LEFT JOIN vn.client c ON c.id = t.clientFk
WHERE sc.id = vParamFk WHERE sc.id = vParamFk
AND t.shipped >= vDated; AND t.shipped >= vDated;
END$$ END$$

View File

@ -0,0 +1,12 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_afterInsert`
AFTER INSERT ON `itemShelving`
FOR EACH ROW
BEGIN
UPDATE sale s
JOIN operator o ON o.workerFk = account.myUser_getId()
SET isPicked = IF(o.isOnReservationMode, isPicked, TRUE)
WHERE id = NEW.saleFk;
END$$
DELIMITER ;

View File

@ -27,4 +27,6 @@ CREATE TABLE vn.itemShelvingSaleReserv (
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId) INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES VALUES
('Collection', 'assignCollection', 'WRITE', 'ALLOW', 'ROLE', 'production'); ('Collection', 'assignCollection', 'WRITE', 'ALLOW', 'ROLE', 'production');
ALTER TABLE vn.operator ADD IF NOT EXISTS isOnReservationMode TINYINT(1) NOT NULL DEFAULT FALSE;