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