-1
We have a differential in the payment of ICMS and I would like to export a spreadsheet which I have already created the command, also create what amount we will pay from ICMS.
In case it would be the following.:
Where we highlight 10% ICMS, we pay only 4% effectively.
Where we highlight 4% of the ICMS, we pay effectively 1.4%
The Current Command:
SELECT DISTINCT nf.codloja,
nf.dtemissao,
nf.numnota,
ni.icms,
Sum(ni.subtoticms) AS toticms
FROM notafiscal nf
JOIN nfitens ni
ON ni.codnf = nf.codnf
WHERE dtemissao BETWEEN '06/01/2019' AND '06/30/2019'
AND COALESCE(nf.anulada, 0) = 0
AND COALESCE(nf.cancelada, 0) = 0
AND codloja = 2
AND COALESCE(nf.protocolonfe, '') <> ''
GROUP BY 1,
2,
3,
4
What exactly values you want to display?
– Ronaldo Araújo Alves
The remarks: "Where we highlight 10% of ICMS, we pay only 4% effectively." and "Where we highlight 4% of the ICMS, we effectively pay 1.4%" refer to which fields of your table(s) ()?
– anonimo
Ronaldo, I would like to already make the calculation of the real value that I will pay in each of the situations. Based on the value of ICMS that I already have and knowing what was the percentage paid in Note.
– Brian Benigno
In the column
icms
tablenfitens
would have the percentages of ICMS (10% and 4%)? And in the columnsubtoticms
would the amount paid? Put some sample records of each table, to help you better understand.– Raquel Pinheiro
It returns with the following example. COD LOJA - DT EMISSAO - NUM NOTA - ICMS - SUM OF ICMS 1 - 25/06/2019- 25656 - 4% - 237,00 1 - 25/06/2019 - 25656 - 10% - 421,00
– Brian Benigno