feat: refs #7531 Added address_hasDelivery
gitea/salix/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Guillermo Bonet 2025-01-16 15:04:21 +01:00
parent c2ca9cfbe5
commit 69b78b6bf1
2 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,9 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`address_hasDelivery`(vSelf INT, vLanded DATE) CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`address_hasDelivery`(
vSelf INT,
vAgencyModeFk INT,
vLanded DATE
)
RETURNS BOOL RETURNS BOOL
DETERMINISTIC DETERMINISTIC
BEGIN BEGIN
@ -15,7 +19,11 @@ BEGIN
CALL zone_getAgency(vSelf, vLanded); CALL zone_getAgency(vSelf, vLanded);
SELECT EXISTS (SELECT TRUE FROM tmp.zoneGetAgency) INTO vHasDelivery; SELECT EXISTS(
SELECT TRUE
FROM tmp.zoneGetAgency
WHERE agencyModeFk = vAgencyModeFk
) INTO vHasDelivery;
RETURN vHasDelivery; RETURN vHasDelivery;

View File

@ -1,6 +1,7 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`zone_getAddresses`( CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`zone_getAddresses`(
vSelf INT, vSelf INT,
vAgencyModeFk INT,
vShipped DATE, vShipped DATE,
vDepartmentFk INT vDepartmentFk INT
) )
@ -52,7 +53,7 @@ BEGIN
AND ct.code = 'normal' AND ct.code = 'normal'
AND bt.code <> 'worker' AND bt.code <> 'worker'
AND (d.id = vDepartmentFk OR vDepartmentFk IS NULL) AND (d.id = vDepartmentFk OR vDepartmentFk IS NULL)
AND vn.address_hasDelivery(c.defaultAddressFk, vShipped) AND vn.address_hasDelivery(c.defaultAddressFk, vAgencyModeFk, vShipped)
GROUP BY c.id; GROUP BY c.id;
DROP TEMPORARY TABLE tmp.zoneNodes; DROP TEMPORARY TABLE tmp.zoneNodes;