#6813 fix creditClient #2026

Merged
jorgep merged 5 commits from 6813-fixCreditClient into dev 2024-02-13 10:53:39 +00:00
1 changed files with 2 additions and 12 deletions
Showing only changes of commit 6116ada156 - Show all commits

View File

@ -8,12 +8,6 @@ BEGIN
END;
START TRANSACTION;
INSERT INTO vn.clientCredit(clientFk, amount)
SELECT c.id, 0
FROM vn.`client` c
JOIN vn.payMethod pm ON pm.id = c.payMethodFk
WHERE c.credit <> 0 AND pm.`code` = 'card';
UPDATE vn.`client` c
JOIN vn.payMethod pm ON pm.id = c.payMethodFk
jorgep marked this conversation as resolved
Review

Esta linea y la 14 es formateo, correcto?

Esta linea y la 14 es formateo, correcto?
Review

Según el experto en base de datos @pablone, el set es más importante que el join.

Según el experto en base de datos @pablone, el set es más importante que el join.
SET credit = 0
@ -45,10 +39,6 @@ BEGIN
JOIN clientes_credit USING(Id_Cliente)
SET Clientes.Credito = newCredit;
INSERT INTO credit(Id_Cliente, amount, Id_Trabajador)
SELECT Id_Cliente, newCredit, NULL
FROM clientes_credit;
DROP TEMPORARY TABLE clientes_credit;
COMMIT;
END$$