2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` PROCEDURE `vn`.`saleTracking_add`(vSaleGroupFk INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
/** Inserta en vn.saleTracking las lineas de una previa
|
|
|
|
*
|
|
|
|
* @param vSaleGroupFk Identificador de vn.saleGroup
|
|
|
|
*/
|
|
|
|
REPLACE vn.saleTracking(
|
|
|
|
saleFk,
|
|
|
|
isChecked,
|
|
|
|
workerFk,
|
|
|
|
stateFk
|
|
|
|
)
|
|
|
|
SELECT sgd.saleFk ,
|
|
|
|
TRUE,
|
|
|
|
account.myUser_getId(),
|
|
|
|
s.id
|
|
|
|
FROM vn.saleGroupDetail sgd
|
|
|
|
JOIN vn.state s ON s.code = 'ON_PREPARATION'
|
|
|
|
WHERE sgd.saleGroupFk = vSaleGroupFk;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|