6921_addFromDelivery #2304

Merged
sergiodt merged 18 commits from 6921_addFromDelivery into dev 2024-04-22 10:33:34 +00:00
1 changed files with 6 additions and 13 deletions
Showing only changes of commit 3f291da02c - Show all commits

View File

@ -1,20 +1,13 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`addNoteFromDelivery`(vTicketFk INT, vDescription TEXT, vCode VARCHAR(45)) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`addNoteFromDelivery`(idTicket INT,nota TEXT)
BEGIN BEGIN
/** DECLARE observationTypeFk INT DEFAULT 3; /*3 = REPARTIDOR*/
* Inserta observaciones para los tickets
*
* @param vTicketFk Identificador del ticket
* @param vDescription Texto de la nota a insertar
* @param vCode Identificador del tipo de nota
*/
INSERT INTO ticketObservation(ticketFk,observationTypeFk,description) INSERT INTO ticketObservation(ticketFk,observationTypeFk,description)
SELECT vTicketFk, id, vDescription VALUES (idTicket,observationTypeFk,nota)
FROM vn.observationType
WHERE code = vCode
ON DUPLICATE KEY UPDATE description = CONCAT(ticketObservation.description,VALUES(description),' '); ON DUPLICATE KEY UPDATE description = CONCAT(ticketObservation.description,VALUES(description),' ');
END$$ END$$
DELIMITER ; DELIMITER ;