refactor: refs #6495 Requested changes
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
216f6f1db3
commit
619ac4e053
|
@ -1,9 +1,9 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_sendMailPurchases`(
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_mailSales`(
|
||||||
vSelf INT,
|
vSelf INT,
|
||||||
vDated DATE
|
vDated DATE
|
||||||
)
|
)
|
||||||
BEGIN
|
proc: BEGIN
|
||||||
/**
|
/**
|
||||||
* Envia un correo electrónico con un resumen de los pedidos
|
* Envia un correo electrónico con un resumen de los pedidos
|
||||||
* preparados para un cliente.
|
* preparados para un cliente.
|
||||||
|
@ -43,14 +43,19 @@ BEGIN
|
||||||
|
|
||||||
SET vDated = IFNULL(vDated, util.yesterday());
|
SET vDated = IFNULL(vDated, util.yesterday());
|
||||||
|
|
||||||
OPEN vTickets;
|
|
||||||
FETCH vTickets INTO vTicketFk, vAlias, vAmount, vStreet, vCity;
|
|
||||||
|
|
||||||
SET vString = CONCAT('<p><font face="verdana" >',
|
SET vString = CONCAT('<p><font face="verdana" >',
|
||||||
'<h2> Relación de envíos.</h2>',
|
'<h2> Relación de envíos.</h2>',
|
||||||
'<h3><font color="green">Dia: ', vDated, '</font></h3>');
|
'<h3><font color="green">Dia: ', vDated, '</font></h3>');
|
||||||
|
|
||||||
WHILE NOT vDone DO
|
OPEN vTickets;
|
||||||
|
l: LOOP
|
||||||
|
SET vDone = FALSE;
|
||||||
|
FETCH vTickets INTO vTicketFk, vAlias, vAmount, vStreet, vCity;
|
||||||
|
|
||||||
|
IF vDone THEN
|
||||||
|
LEAVE l;
|
||||||
|
END IF;
|
||||||
|
|
||||||
SET vString = CONCAT(vString, '<br><br>',
|
SET vString = CONCAT(vString, '<br><br>',
|
||||||
'<table>
|
'<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -63,29 +68,34 @@ BEGIN
|
||||||
</table>',
|
</table>',
|
||||||
' ', vAlias, '<br>',
|
' ', vAlias, '<br>',
|
||||||
' ', vStreet, '(', vCity, ')');
|
' ', vStreet, '(', vCity, ')');
|
||||||
FETCH vTickets INTO vTicketFk, vAlias, vAmount, vStreet, vCity;
|
END LOOP;
|
||||||
END WHILE;
|
|
||||||
|
IF vTicketFk IS NULL THEN
|
||||||
|
LEAVE proc;
|
||||||
|
END IF;
|
||||||
|
|
||||||
SET vString = CONCAT(
|
SET vString = CONCAT(
|
||||||
vString,
|
vString,
|
||||||
'<table>',
|
'<table>',
|
||||||
'<tr><th></th></tr>',
|
'<tr><th></th></tr>',
|
||||||
'</table>',
|
'</table>',
|
||||||
'<br><br>Puede acceder al detalle de los albaranes haciendo click sobre el número de Ticket',
|
'<br><br>Puede acceder al detalle de los albaranes haciendo click sobre el número de Ticket',
|
||||||
'<br><h3> Muchas gracias por su confianza</h3>',
|
'<br><h3> Muchas gracias por su confianza</h3>',
|
||||||
'</font></p>');
|
'</font></p>');
|
||||||
|
|
||||||
-- Envío del email
|
SELECT email INTO vMailTo
|
||||||
SELECT CONCAT(email,', pako@verdnatura.es') INTO vMailTo
|
|
||||||
FROM client
|
FROM client
|
||||||
WHERE id = vSelf
|
WHERE id = vSelf
|
||||||
AND email <> '';
|
AND email <> '';
|
||||||
|
|
||||||
CALL mail_insert(
|
-- Envío del email
|
||||||
IFNULL(vMailTo, 'pako.natek@gmail.com'),
|
IF vMailTo IS NOT NULL THEN
|
||||||
'pako@verdnatura.es',
|
CALL mail_insert(
|
||||||
'Resumen de pedidos preparados',
|
vMailTo,
|
||||||
vString
|
NULL,
|
||||||
);
|
'Resumen de pedidos preparados',
|
||||||
|
vString
|
||||||
|
);
|
||||||
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
|
@ -1,5 +1,5 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_sendMailPurchasesLauncher`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`client_mailSalesLauncher`()
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Lanza el envío de correos electrónicos con el resumen de pedidos
|
* Lanza el envío de correos electrónicos con el resumen de pedidos
|
||||||
|
@ -17,11 +17,14 @@ BEGIN
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||||
|
|
||||||
OPEN vClients;
|
OPEN vClients;
|
||||||
FETCH vClients INTO vClientFk;
|
l: LOOP
|
||||||
|
SET vDone = FALSE;
|
||||||
WHILE NOT vDone DO
|
|
||||||
CALL client_sendMailPurchases(util.yesterday(), vClientFk);
|
|
||||||
FETCH vClients INTO vClientFk;
|
FETCH vClients INTO vClientFk;
|
||||||
END WHILE;
|
|
||||||
|
IF vDone THEN
|
||||||
|
LEAVE l;
|
||||||
|
END IF;
|
||||||
|
CALL client_mailSales(vClientFk, util.yesterday());
|
||||||
|
END LOOP;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
|
@ -1,4 +1,4 @@
|
||||||
UPDATE IGNORE bs.nightTask
|
UPDATE IGNORE bs.nightTask
|
||||||
SET `procedure` = 'client_sendMailPurchasesLauncher',
|
SET `procedure` = 'client_mailSalesLauncher',
|
||||||
`schema` = 'vn'
|
`schema` = 'vn'
|
||||||
WHERE `procedure` = 'emailYesterdayPurchasesLauncher';
|
WHERE `procedure` = 'emailYesterdayPurchasesLauncher';
|
||||||
|
|
Loading…
Reference in New Issue