fix(expencefk): refs #6398 expenceFk to expenseFk
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
bec1ff71ef
commit
303b6f5240
|
@ -450,13 +450,13 @@ BEGIN
|
||||||
INSERT INTO ticketTracking(stateFk, ticketFk, userFk)
|
INSERT INTO ticketTracking(stateFk, ticketFk, userFk)
|
||||||
SELECT * FROM tmp.updateInter;
|
SELECT * FROM tmp.updateInter;
|
||||||
|
|
||||||
CALL invoiceExpenceMake(vNewInvoiceId);
|
CALL invoiceExpenseMake(vNewInvoiceId);
|
||||||
CALL invoiceTaxMake(vNewInvoiceId, vTaxArea);
|
CALL invoiceTaxMake(vNewInvoiceId, vTaxArea);
|
||||||
|
|
||||||
UPDATE invoiceOut io
|
UPDATE invoiceOut io
|
||||||
JOIN (
|
JOIN (
|
||||||
SELECT SUM(amount) total
|
SELECT SUM(amount) total
|
||||||
FROM invoiceOutExpence
|
FROM invoiceOutExpense
|
||||||
WHERE invoiceOutFk = vNewInvoiceId
|
WHERE invoiceOutFk = vNewInvoiceId
|
||||||
) base
|
) base
|
||||||
JOIN (
|
JOIN (
|
||||||
|
@ -493,15 +493,15 @@ BEGIN
|
||||||
SET @vTaxableBaseServices := 0.00;
|
SET @vTaxableBaseServices := 0.00;
|
||||||
SET @vTaxCodeGeneral := NULL;
|
SET @vTaxCodeGeneral := NULL;
|
||||||
|
|
||||||
INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, taxTypeSageFk, transactionTypeSageFk)
|
INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenseFk, taxTypeSageFk, transactionTypeSageFk)
|
||||||
SELECT vNewInvoiceInFk,
|
SELECT vNewInvoiceInFk,
|
||||||
@vTaxableBaseServices,
|
@vTaxableBaseServices,
|
||||||
sub.expenceFk,
|
sub.expenseFk,
|
||||||
sub.taxTypeSageFk,
|
sub.taxTypeSageFk,
|
||||||
sub.transactionTypeSageFk
|
sub.transactionTypeSageFk
|
||||||
FROM (
|
FROM (
|
||||||
SELECT @vTaxableBaseServices := SUM(tst.taxableBase) taxableBase,
|
SELECT @vTaxableBaseServices := SUM(tst.taxableBase) taxableBase,
|
||||||
i.expenceFk,
|
i.expenseFk,
|
||||||
i.taxTypeSageFk,
|
i.taxTypeSageFk,
|
||||||
i.transactionTypeSageFk,
|
i.transactionTypeSageFk,
|
||||||
@vTaxCodeGeneral := i.taxClassCodeFk
|
@vTaxCodeGeneral := i.taxClassCodeFk
|
||||||
|
@ -511,11 +511,11 @@ BEGIN
|
||||||
HAVING taxableBase
|
HAVING taxableBase
|
||||||
) sub;
|
) sub;
|
||||||
|
|
||||||
INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, taxTypeSageFk, transactionTypeSageFk)
|
INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenseFk, taxTypeSageFk, transactionTypeSageFk)
|
||||||
SELECT vNewInvoiceInFk,
|
SELECT vNewInvoiceInFk,
|
||||||
SUM(tt.taxableBase) - IF(tt.code = @vTaxCodeGeneral,
|
SUM(tt.taxableBase) - IF(tt.code = @vTaxCodeGeneral,
|
||||||
@vTaxableBaseServices, 0) taxableBase,
|
@vTaxableBaseServices, 0) taxableBase,
|
||||||
i.expenceFk,
|
i.expenseFk,
|
||||||
i.taxTypeSageFk ,
|
i.taxTypeSageFk ,
|
||||||
i.transactionTypeSageFk
|
i.transactionTypeSageFk
|
||||||
FROM tmp.ticketTax tt
|
FROM tmp.ticketTax tt
|
||||||
|
|
Loading…
Reference in New Issue