fix: refs #6861 saleTrackingAdd
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Sergio De la torre 2024-10-17 17:01:44 +02:00
parent cb53962405
commit 63c0ec308f
1 changed files with 13 additions and 11 deletions

View File

@ -1,5 +1,7 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`saleTracking_sectorCollectionAddPrevOK`(vSectorCollectionFk INT) CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`saleTracking_sectorCollectionAddPrevOK`(
vSectorCollectionFk INT
)
BEGIN BEGIN
/** /**
* Inserta los registros de sectorCollection con el estado PREVIA OK si la reserva está picked * Inserta los registros de sectorCollection con el estado PREVIA OK si la reserva está picked
@ -12,15 +14,15 @@ BEGIN
workerFk, workerFk,
stateFk stateFk
) )
SELECT sgd.saleFk, SELECT sgd.saleFk,
TRUE, TRUE,
sc.userFk, sc.userFk,
s.id s.id
FROM vn.sectorCollection sc FROM sectorCollection sc
JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id
JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk
JOIN state s ON s.code = 'OK PREVIOUS' JOIN state s ON s.code = 'OK PREVIOUS'
JOIN itemShelvingSale iss ON iss.saleFk = sgd.saleFk JOIN itemShelvingSale iss ON iss.saleFk = sgd.saleFk
WHERE sc.id = vSectorCollectionFk AND iss.isPicked; WHERE sc.id = vSectorCollectionFk AND iss.isPicked;
END$$ END$$
DELIMITER ; DELIMITER ;