2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`entry_notifyChanged`(vSelf INT, vBuyFk INT, vOldValues VARCHAR(512), vNewValues VARCHAR(512))
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
DECLARE vEmail VARCHAR(255);
|
|
|
|
DECLARE vFields VARCHAR(100);
|
|
|
|
DECLARE vMessage TEXT;
|
|
|
|
|
|
|
|
SELECT e.mailToNotify INTO vEmail
|
|
|
|
FROM entryConfig e
|
|
|
|
LIMIT 1;
|
|
|
|
|
|
|
|
SET vFields = CONCAT_WS(',',
|
|
|
|
'entryFk',
|
|
|
|
'itemFk',
|
|
|
|
'quantity',
|
|
|
|
'price1',
|
|
|
|
'price2',
|
|
|
|
'price3'
|
|
|
|
);
|
|
|
|
SET vMessage = util.formatTable(vFields, vOldValues, vNewValues);
|
|
|
|
|
|
|
|
CALL mail_insert(
|
|
|
|
vEmail,
|
|
|
|
NULL,
|
|
|
|
CONCAT(
|
|
|
|
'Se ha modificado una línea de la entrada ', vSelf
|
|
|
|
,' siendo inventario o anterior al mismo'
|
|
|
|
),
|
|
|
|
vMessage
|
|
|
|
);
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|