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