hotfix: ticket 189567
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-05-31 12:28:47 +02:00
parent 46065a983f
commit d27bbd9a8f
1 changed files with 3 additions and 5 deletions

View File

@ -11,10 +11,7 @@ BEGIN
*/
DECLARE vClient INT DEFAULT NULL;
-- SET vPhone = vPhone COLLATE 'utf8_unicode_ci';
DROP TEMPORARY TABLE IF EXISTS tClient;
CREATE TEMPORARY TABLE tClient
CREATE OR REPLACE TEMPORARY TABLE tClient
ENGINE = MEMORY
SELECT id clientFk
FROM `client`
@ -27,13 +24,14 @@ BEGIN
OR mobile = vPhone
UNION
SELECT clientFk
FROM vn.clientContact
FROM clientContact
WHERE phone = vPhone;
SELECT t.clientFk INTO vClient
FROM tClient t
JOIN `client` c ON c.id = t.clientFk
WHERE c.isActive
AND c.salesPersonFk
LIMIT 1;
DROP TEMPORARY TABLE tClient;