receipt_beforInsert
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Javi Gallego 2021-01-20 13:54:55 +01:00
parent e47e5b9ec4
commit a6dfdc971a
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
DROP TRIGGER IF EXISTS vn.receipt_beforInsert;
DELIMITER $$
$$
CREATE TRIGGER receipt_beforInsert
BEFORE INSERT
ON receipt FOR EACH ROW
BEGIN
SELECT isAutoConciliated INTO @isAutoConciliated
FROM accounting a
JOIN accountingType at2 ON at2.id = a.accountingTypeFk
WHERE a.id =NEW.bankFk;
SET NEW.isConciliate = @isAutoConciliated;
END
$$
DELIMITER ;