refs #6915 test_master24_8 #2067
|
@ -3,11 +3,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`awbInvoiceIn_afterDel
|
||||||
AFTER DELETE ON `awbInvoiceIn`
|
AFTER DELETE ON `awbInvoiceIn`
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
IF (SELECT COUNT(*) FROM invoiceInTax where invoiceInFk = OLD.invoiceInFk) = 0
|
IF (NOT(SELECT COUNT(*) FROM invoiceInTax where invoiceInFk = OLD.invoiceInFk))
|
||||||
AND
|
AND
|
||||||
(SELECT COUNT(*) FROM invoiceInDueDay where invoiceInFk = OLD.invoiceInFk) = 0
|
(NOT(SELECT COUNT(*) FROM invoiceInDueDay where invoiceInFk = OLD.invoiceInFk))
|
||||||
AND
|
AND
|
||||||
(SELECT isBooked FROM invoiceIn WHERE id = OLD.invoiceInFk) = 0
|
(NOT(SELECT isBooked FROM invoiceIn WHERE id = OLD.invoiceInFk) )
|
||||||
THEN
|
THEN
|
||||||
DELETE FROM invoiceIn WHERE id = OLD.invoiceInFk;
|
DELETE FROM invoiceIn WHERE id = OLD.invoiceInFk;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
Loading…
Reference in New Issue