fix: refs #6861 saleTrackingAdd #3121

Merged
sergiodt merged 4 commits from 6861-ReserveSaleTracking into master 2024-10-17 15:29:13 +00:00
1 changed files with 26 additions and 0 deletions
Showing only changes of commit cb53962405 - Show all commits

View File

@ -0,0 +1,26 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`saleTracking_sectorCollectionAddPrevOK`(vSectorCollectionFk INT)
sergiodt marked this conversation as resolved Outdated

Salto de línea

Salto de línea
BEGIN
/**
sergiodt marked this conversation as resolved Outdated

Tabulación ) -1

Tabulación ) -1
* 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,
sergiodt marked this conversation as resolved Outdated

Tabulación

Tabulación
stateFk
)
SELECT sgd.saleFk,
sergiodt marked this conversation as resolved Outdated

Tabulación )

Tabulación )
TRUE,
sergiodt marked this conversation as resolved Outdated

Tabulación

Tabulación
sc.userFk,
s.id
FROM vn.sectorCollection sc
sergiodt marked this conversation as resolved Outdated

esquema no es necesario

esquema no es necesario
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 ;