This commit is contained in:
parent
cb53962405
commit
63c0ec308f
|
@ -1,5 +1,7 @@
|
|||
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
|
||||
/**
|
||||
* Inserta los registros de sectorCollection con el estado PREVIA OK si la reserva está picked
|
||||
|
@ -12,15 +14,15 @@ BEGIN
|
|||
workerFk,
|
||||
stateFk
|
||||
)
|
||||
SELECT sgd.saleFk,
|
||||
TRUE,
|
||||
sc.userFk,
|
||||
s.id
|
||||
FROM vn.sectorCollection sc
|
||||
JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id
|
||||
JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk
|
||||
JOIN state s ON s.code = 'OK PREVIOUS'
|
||||
JOIN itemShelvingSale iss ON iss.saleFk = sgd.saleFk
|
||||
WHERE sc.id = vSectorCollectionFk AND iss.isPicked;
|
||||
SELECT sgd.saleFk,
|
||||
TRUE,
|
||||
sc.userFk,
|
||||
s.id
|
||||
FROM sectorCollection sc
|
||||
JOIN sectorCollectionSaleGroup scsg ON scsg.sectorCollectionFk = sc.id
|
||||
JOIN saleGroupDetail sgd ON sgd.saleGroupFk = scsg.saleGroupFk
|
||||
JOIN state s ON s.code = 'OK PREVIOUS'
|
||||
JOIN itemShelvingSale iss ON iss.saleFk = sgd.saleFk
|
||||
WHERE sc.id = vSectorCollectionFk AND iss.isPicked;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
Loading…
Reference in New Issue