From 303b6f524051e05439eb8bd0342e9a97771727cd Mon Sep 17 00:00:00 2001 From: pablone Date: Fri, 1 Dec 2023 13:48:56 +0100 Subject: [PATCH] fix(expencefk): refs #6398 expenceFk to expenseFk --- db/changes/235001/01-procedures.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/db/changes/235001/01-procedures.sql b/db/changes/235001/01-procedures.sql index 121348fbf..3777708d5 100644 --- a/db/changes/235001/01-procedures.sql +++ b/db/changes/235001/01-procedures.sql @@ -450,13 +450,13 @@ BEGIN INSERT INTO ticketTracking(stateFk, ticketFk, userFk) SELECT * FROM tmp.updateInter; - CALL invoiceExpenceMake(vNewInvoiceId); + CALL invoiceExpenseMake(vNewInvoiceId); CALL invoiceTaxMake(vNewInvoiceId, vTaxArea); UPDATE invoiceOut io JOIN ( SELECT SUM(amount) total - FROM invoiceOutExpence + FROM invoiceOutExpense WHERE invoiceOutFk = vNewInvoiceId ) base JOIN ( @@ -493,15 +493,15 @@ BEGIN SET @vTaxableBaseServices := 0.00; SET @vTaxCodeGeneral := NULL; - INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, taxTypeSageFk, transactionTypeSageFk) + INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenseFk, taxTypeSageFk, transactionTypeSageFk) SELECT vNewInvoiceInFk, @vTaxableBaseServices, - sub.expenceFk, + sub.expenseFk, sub.taxTypeSageFk, sub.transactionTypeSageFk FROM ( SELECT @vTaxableBaseServices := SUM(tst.taxableBase) taxableBase, - i.expenceFk, + i.expenseFk, i.taxTypeSageFk, i.transactionTypeSageFk, @vTaxCodeGeneral := i.taxClassCodeFk @@ -511,11 +511,11 @@ BEGIN HAVING taxableBase ) sub; - INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, taxTypeSageFk, transactionTypeSageFk) + INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenseFk, taxTypeSageFk, transactionTypeSageFk) SELECT vNewInvoiceInFk, SUM(tt.taxableBase) - IF(tt.code = @vTaxCodeGeneral, @vTaxableBaseServices, 0) taxableBase, - i.expenceFk, + i.expenseFk, i.taxTypeSageFk , i.transactionTypeSageFk FROM tmp.ticketTax tt