This commit is contained in:
parent
7c2c56ed9a
commit
f69dfbd5aa
|
@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`invoiceIn_afterUpdate`
|
|||
BEGIN
|
||||
DECLARE vIsEuro BOOL;
|
||||
|
||||
SELECT if(`code` = 'EUR', TRUE, FALSE) INTO vIsEuro
|
||||
SELECT `code` = 'EUR' INTO vIsEuro
|
||||
FROM currency
|
||||
WHERE id = NEW.currencyFk;
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
DROP TRIGGER IF EXISTS invoiceIn_beforeUpdate;
|
||||
|
||||
UPDATE vn.invoiceIn
|
||||
UPDATE invoiceIn
|
||||
SET cplusRectificationTypeFk = NULL
|
||||
WHERE cplusRectificationTypeFk = 1;
|
||||
|
||||
DELETE IGNORE FROM vn.cplusRectificationType WHERE id = 1;
|
||||
DELETE IGNORE FROM cplusRectificationType WHERE id = 1;
|
||||
|
||||
UPDATE vn.cplusRectificationType
|
||||
UPDATE cplusRectificationType
|
||||
SET id = 1
|
||||
WHERE id = 3;
|
||||
|
||||
|
@ -25,7 +25,7 @@ BEGIN
|
|||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
IF (SELECT COUNT(*) FROM vn.invoiceIn
|
||||
IF (SELECT COUNT(*) FROM invoiceIn
|
||||
WHERE supplierRef = NEW.supplierRef
|
||||
AND supplierFk = NEW.supplierFk
|
||||
AND YEAR(issued) = YEAR(NEW.issued)
|
||||
|
@ -37,7 +37,7 @@ BEGIN
|
|||
IF NEW.supplierFk != OLD.supplierFk THEN
|
||||
CALL supplier_checkIsActive(NEW.supplierFk);
|
||||
SELECT withholdingSageFk INTO vWithholdingSageFk
|
||||
FROM vn.supplier
|
||||
FROM supplier
|
||||
WHERE id = NEW.supplierFk;
|
||||
SET NEW.withholdingSageFk = vWithholdingSageFk;
|
||||
END IF;
|
||||
|
|
Loading…
Reference in New Issue