Last active
November 29, 2015 18:03
-
-
Save diego-aslz/dfdf89f430e532f42310 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| -- Edit Query. Adicionar abaixo de: | |
| -- AND | |
| -- V.DT_CANCELAMENTO IS NULL | |
| -- A seguinte SQL: | |
| AND | |
| DATEADD(-3 HOUR TO DT_EMISSAO) BETWEEN :DT_INICIO | |
| AND DATEADD(1 DAY TO :DT_FIM) |
This file contains hidden or 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
| -- Edit Query. Adicionar abaixo de: | |
| -- DT_CANCELAMENTO IS NOT NULL | |
| -- A seguinte SQL: | |
| AND | |
| DATEADD(-3 HOUR TO DT_EMISSAO) BETWEEN :DT_INICIO | |
| AND DATEADD(1 DAY TO :DT_FIM) |
This file contains hidden or 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
| // Novo código do botão para Relatório de Fechamento de Vendas | |
| procedure TFVendasCad.Fechamento1Click(Sender: TObject); | |
| begin | |
| inherited; | |
| if FVendasParam = nil then | |
| FVendasParam := TFVendasParam.Create(Application); | |
| FVendasParam.AtivaPagina(0); | |
| if FVendasParam.ShowModal = MrOk then | |
| with DMRelatorio do | |
| begin | |
| QRFechamentoVendas.Close; | |
| QRFechamentoVendas.ParamByName('DT_INICIO').AsDate := | |
| StrToDate(FVendasParam.ME1DataInicial.Text); | |
| QRFechamentoVendas.ParamByName('DT_FIM').AsDate := | |
| StrToDate(FVendasParam.ME1DataFinal.Text); | |
| QRFechamentoVendas.Open; | |
| QRFechamentoVendasCanceladas.Close; | |
| QRFechamentoVendasCanceladas.ParamByName('DT_INICIO').AsDate := | |
| StrToDate(FVendasParam.ME1DataInicial.Text); | |
| QRFechamentoVendasCanceladas.ParamByName('DT_FIM').AsDate := | |
| StrToDate(FVendasParam.ME1DataFinal.Text); | |
| QRFechamentoVendasCanceladas.Open; | |
| ImprimeFechamentoVendas; | |
| end; | |
| end; |
This file contains hidden or 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
| // Clicar no Form -> Eventos -> OnCreate: | |
| procedure TFVendasParam.FormCreate(Sender: TObject); | |
| begin | |
| inherited; | |
| ME1DataInicial.Text := FormatDateTime('DD/MM/YYYY', Now); | |
| ME1DataFinal.Text := ME1DataInicial.Text; | |
| end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment