fix: refs #7936 conflicts
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
4612bf2e9b
commit
d9eab36160
|
@ -25,7 +25,7 @@ BEGIN
|
||||||
DECLARE vIsInformativeExportation BOOL DEFAULT FALSE;
|
DECLARE vIsInformativeExportation BOOL DEFAULT FALSE;
|
||||||
|
|
||||||
DECLARE vCursor CURSOR FOR
|
DECLARE vCursor CURSOR FOR
|
||||||
SELECT it.taxableBase,
|
SELECT SUM(it.taxableBase),
|
||||||
CAST(SUM((( it.taxableBase / 100) * t.PorcentajeIva)) AS DECIMAL (10,2)),
|
CAST(SUM((( it.taxableBase / 100) * t.PorcentajeIva)) AS DECIMAL (10,2)),
|
||||||
t.PorcentajeIva,
|
t.PorcentajeIva,
|
||||||
it.transactionTypeSageFk,
|
it.transactionTypeSageFk,
|
||||||
|
@ -204,25 +204,25 @@ BEGIN
|
||||||
FROM vn.invoiceInCorrection
|
FROM vn.invoiceInCorrection
|
||||||
WHERE correctingFk = vInvoiceInFk;
|
WHERE correctingFk = vInvoiceInFk;
|
||||||
|
|
||||||
IF vInvoiceInOriginalFk THEN
|
IF vInvoiceInOriginalFk THEN
|
||||||
UPDATE movContaIVA mci
|
UPDATE movContaIVA mci
|
||||||
JOIN vn.invoiceInCorrection iic ON iic.correctingFk = vInvoiceInFk
|
JOIN vn.invoiceInCorrection iic ON iic.correctingFk = vInvoiceInFk
|
||||||
JOIN vn.siiTypeInvoiceIn st ON st.id = iic.siiTypeInvoiceInFk
|
JOIN vn.siiTypeInvoiceIn st ON st.id = iic.siiTypeInvoiceInFk
|
||||||
JOIN (SELECT issued,
|
JOIN (SELECT issued,
|
||||||
SUM(sub.taxableBase) taxableBase,
|
SUM(sub.taxableBase) taxableBase,
|
||||||
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
SUM(ROUND((sub.taxableBase * sub.PorcentajeIva) / 100 , 2)) vat
|
||||||
FROM(SELECT issued,
|
FROM(SELECT issued,
|
||||||
SUM(iit.taxableBase) taxableBase,
|
SUM(iit.taxableBase) taxableBase,
|
||||||
ti.PorcentajeIva
|
ti.PorcentajeIva
|
||||||
FROM vn.invoiceIn i
|
FROM vn.invoiceIn i
|
||||||
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
JOIN vn.invoiceInTax iit ON iit.invoiceInFk = i.id
|
||||||
JOIN TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
JOIN TiposIva ti ON ti.CodigoIva = iit.taxTypeSageFk
|
||||||
WHERE i.id = vInvoiceInOriginalFk
|
WHERE i.id = vInvoiceInOriginalFk
|
||||||
GROUP BY ti.CodigoIva)sub
|
GROUP BY ti.CodigoIva)sub
|
||||||
)invoiceInOriginal
|
)invoiceInOriginal
|
||||||
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
JOIN ClavesOperacion co ON co.Descripcion = 'Factura rectificativa'
|
||||||
SET mci.TipoRectificativa = iic.cplusRectificationTypeFk,
|
SET mci.TipoRectificativa = iir.refundCategoryFk,
|
||||||
mci.ClaseAbonoRectificativas = REGEXP_REPLACE(st.`code`, '[^0-9]', ''),
|
mci.ClaseAbonoRectificativas = iir.refundType,
|
||||||
mci.FechaFacturaOriginal = invoiceInOriginal.issued,
|
mci.FechaFacturaOriginal = invoiceInOriginal.issued,
|
||||||
mci.FechaOperacion = invoiceInOriginal.issued,
|
mci.FechaOperacion = invoiceInOriginal.issued,
|
||||||
mci.BaseImponibleOriginal = invoiceInOriginal.taxableBase,
|
mci.BaseImponibleOriginal = invoiceInOriginal.taxableBase,
|
||||||
|
@ -231,5 +231,4 @@ BEGIN
|
||||||
WHERE mci.id = vXDiarioFk;
|
WHERE mci.id = vXDiarioFk;
|
||||||
END IF;
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
$$
|
DELIMITER ;
|
||||||
DELIMITER ;
|
|
||||||
|
|
Loading…
Reference in New Issue