Created
June 5, 2016 18:09
-
-
Save diego-aslz/58fa454af0e834982bc6ca84f818c2da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
I.ID_PRODUTO, | |
P.NOME, | |
SUM(I.QUANTIDADE) AS QUANTIDADE, | |
AVG(I.VALOR_UNITARIO) AS VALOR_UNITARIO, | |
SUM(I.DESCONTO) AS DESCONTO, | |
SUM(I.VALOR) AS VALOR, | |
MIN(I.DT_LANCAMENTO) AS DT_LANCAMENTO | |
FROM ITENS I | |
JOIN PRODUTOS P | |
ON P.ID = I.ID_PRODUTO | |
WHERE ID_VENDA = :VENDA | |
GROUP BY I.ID_PRODUTO, P.NOME | |
ORDER BY MIN(DT_LANCAMENTO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TFVendasCad.ImprimeFechamento; | |
begin | |
if FRFechamentoVenda = nil then | |
FRFechamentoVenda := TFRFechamentoVenda.Create(Application); | |
DMConfiguracoes.QConfiguracoes.Close; | |
DMConfiguracoes.QConfiguracoes.Open; | |
QItensFechamento.Close; | |
QItensFechamento.ParamByName('VENDA').AsInteger := QCadastroID.Value; | |
QItensFechamento.Open; | |
FRFechamentoVenda.QRRelatorio.Preview; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment