From bb8379f8dbdec5bbec388193b03aea16bd01eeed Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 18 Apr 2024 14:42:29 +0200 Subject: [PATCH] refactor: refs #6724 Minor change --- .../vn/procedures/invoiceInTax_getFromEntries.sql | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/db/routines/vn/procedures/invoiceInTax_getFromEntries.sql b/db/routines/vn/procedures/invoiceInTax_getFromEntries.sql index 5a53b7543..631b8f31c 100644 --- a/db/routines/vn/procedures/invoiceInTax_getFromEntries.sql +++ b/db/routines/vn/procedures/invoiceInTax_getFromEntries.sql @@ -4,16 +4,9 @@ BEGIN DECLARE vRate DOUBLE DEFAULT 1; DECLARE vDated DATE; DECLARE vExpenseFk VARCHAR(10); - DECLARE vIsBooked BOOLEAN DEFAULT FALSE; - SELECT isBooked INTO vIsBooked - FROM invoiceIn ii - WHERE id = vInvoiceInFk; + CALL invoiceIn_checkBooked(vInvoiceInFk); - IF vIsBooked THEN - CALL util.throw('A booked invoice cannot be modified'); - END IF; - SELECT MAX(rr.dated) INTO vDated FROM referenceRate rr JOIN invoiceIn ii ON ii.id = vInvoiceInFk