Reviewed-on: #2026 Reviewed-by: Javi Gallego <jgallego@verdnatura.es> Reviewed-by: JAVIER SEGARRA MARTINEZ <jsegarra@verdnatura.es>
This commit is contained in:
commit
9bd8c21660
|
@ -8,12 +8,6 @@ BEGIN
|
||||||
END;
|
END;
|
||||||
|
|
||||||
START TRANSACTION;
|
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
|
UPDATE vn.`client` c
|
||||||
JOIN vn.payMethod pm ON pm.id = c.payMethodFk
|
JOIN vn.payMethod pm ON pm.id = c.payMethodFk
|
||||||
SET credit = 0
|
SET credit = 0
|
||||||
|
@ -45,10 +39,6 @@ BEGIN
|
||||||
JOIN clientes_credit USING(Id_Cliente)
|
JOIN clientes_credit USING(Id_Cliente)
|
||||||
SET Clientes.Credito = newCredit;
|
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;
|
DROP TEMPORARY TABLE clientes_credit;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
END$$
|
END$$
|
||||||
|
|
Loading…
Reference in New Issue