fix: refs #7829 Error al calcular problemas de componentes #2828
|
@ -103,7 +103,8 @@ BEGIN
|
||||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||||
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
|
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
|
||||||
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
|
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
|
||||||
LEFT JOIN component c ON c.id = sc.componentFk AND c.isRequired
|
LEFT JOIN component c ON c.id = sc.componentFk
|
||||||
|
AND c.isRequired
|
||||||
WHERE dm.code IN ('AGENCY','DELIVERY','PICKUP')
|
WHERE dm.code IN ('AGENCY','DELIVERY','PICKUP')
|
||||||
AND s.quantity > 0
|
AND s.quantity > 0
|
||||||
GROUP BY s.id
|
GROUP BY s.id
|
||||||
|
|
|
@ -4,7 +4,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setProblemRi
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Updates future ticket risk for a client
|
* Updates future ticket risk for a client.
|
||||||
*
|
*
|
||||||
* @param vClientFk Id client
|
* @param vClientFk Id client
|
||||||
*/
|
*/
|
||||||
|
@ -14,7 +14,8 @@ BEGIN
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM ticket
|
FROM ticket
|
||||||
WHERE clientFk = vClientFk
|
WHERE clientFk = vClientFk
|
||||||
AND shipped >= util.VN_CURDATE();
|
AND shipped >= util.VN_CURDATE()
|
||||||
|
AND refFk IS NULL;
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||||
|
|
||||||
|
@ -29,7 +30,6 @@ BEGIN
|
||||||
|
|
||||||
CALL vn.ticket_setProblemRisk(vTicketFk);
|
CALL vn.ticket_setProblemRisk(vTicketFk);
|
||||||
END LOOP;
|
END LOOP;
|
||||||
|
|||||||
|
|
||||||
CLOSE vTickets;
|
CLOSE vTickets;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
Loading…
Reference in New Issue
Quitar espacio