fix: refs #6861 saleTrackingAdd #3121
|
@ -1,23 +1,15 @@
|
|||
DELIMITER $$
|
||||
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
|
||||
*
|
||||
* @param vSectorCollectionFk Identificador de vn.sectorCollection
|
||||
*/
|
||||
REPLACE saleTracking(
|
||||
saleFk,
|
||||
isChecked,
|
||||
workerFk,
|
||||
stateFk
|
||||
)
|
||||
SELECT sgd.saleFk,
|
||||
TRUE,
|
||||
sc.userFk,
|
||||
s.id
|
||||
REPLACE saleTracking(saleFk, isChecked, workerFk, stateFk)
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue