7253-devToTest_2418 #2350
|
@ -7,10 +7,10 @@ BEGIN
|
||||||
SELECT
|
SELECT
|
||||||
t.year,
|
t.year,
|
||||||
t.month,
|
t.month,
|
||||||
pagos.dollars,
|
pay.dollars,
|
||||||
pagos.changePractical,
|
pay.changePractical,
|
||||||
CAST(SUM(iit.foreignValue ) / SUM(iit.taxableBase) AS DECIMAL(5,4)) cambioTeorico,
|
CAST(SUM(iit.foreignValue ) / SUM(iit.taxableBase) AS DECIMAL(5,4)) cambioTeorico,
|
||||||
pagos.changeOfficial
|
pay.changeOfficial
|
||||||
FROM invoiceIn ii
|
FROM invoiceIn ii
|
||||||
JOIN time t ON t.dated = ii.issued
|
JOIN time t ON t.dated = ii.issued
|
||||||
JOIN invoiceInTax iit ON ii.id = iit.invoiceInFk
|
JOIN invoiceInTax iit ON ii.id = iit.invoiceInFk
|
||||||
|
@ -28,7 +28,7 @@ BEGIN
|
||||||
WHERE p.divisa
|
WHERE p.divisa
|
||||||
AND c.code = 'USD'
|
AND c.code = 'USD'
|
||||||
GROUP BY t.year, t.month
|
GROUP BY t.year, t.month
|
||||||
) pagos ON t.year = pagos.year AND t.month = pagos.MONTH
|
) pay ON t.year = pay.year AND t.month = pay.month
|
||||||
JOIN currency c ON c.id = ii.currencyFk
|
JOIN currency c ON c.id = ii.currencyFk
|
||||||
WHERE c.code = 'USD'
|
WHERE c.code = 'USD'
|
||||||
AND iit.foreignValue
|
AND iit.foreignValue
|
||||||
|
|
Loading…
Reference in New Issue