ActiveDelphi - Índice do Fórum ActiveDelphi
.: O site do programador Delphi! :.
 
 FAQFAQ   PesquisarPesquisar   MembrosMembros   GruposGrupos   RegistrarRegistrar 
 PerfilPerfil   Entrar e ver Mensagens ParticularesEntrar e ver Mensagens Particulares   EntrarEntrar 

Incrementar data de vencimento DateTimerPicker

 
Novo Tópico   Responder Mensagem    ActiveDelphi - Índice do Fórum -> Delphi
Exibir mensagem anterior :: Exibir próxima mensagem  
Autor Mensagem
adriano_servitec
Colaborador
Colaborador


Registrado: Sexta-Feira, 30 de Janeiro de 2004
Mensagens: 17618

MensagemEnviada: Qua Ago 01, 2018 5:11 pm    Assunto: Incrementar data de vencimento DateTimerPicker Responder com Citação

Tenho este codigo
Código:
procedure TfrmPagamento.dtpBoletoProprio1Change(Sender: TObject);
var
  I: Integer;
  DataVencimento: TDate;
begin
  inherited;
  for I := 1 to QtdParcelas do
  begin
    if iIDFormaPagamento = 2 then
    begin
      /// Na forma de pagamento em cheque sempre inicia com primeiro pagamento a vista
      if (I > 1) then
        DataVencimento := IncMonth(TDateTimePicker(Sender).Date, I - 1)
      else
        DataVencimento := TDateTimePicker(Sender).Date;
    end
    else
    begin
      /// Outras formas de pagamento que não seja o cheque
      if (I > 1) then
        DataVencimento := IncMonth(TDateTimePicker(Sender).Date, I)
      else
        DataVencimento := IncMonth(TDateTimePicker(Sender).Date, I);
    end;

    if (DayOfWeek(DataVencimento) = 1) then
      DataVencimento := DataVencimento - 2
    else if (DayOfWeek(DataVencimento) = 7) then
      DataVencimento := DataVencimento - 1;
    // Preenche a data de vencimento
    TDateTimePicker(FindComponent(NomeDatePickerParcela + IntToStr(I))).Date :=
      DataVencimento;
    TDateTimePicker(FindComponent(NomeDatePickerParcela + IntToStr(I)))
      .TabStop := True;
  end;
end;


Faço uma venda em 3 x com vencimento da primeira parcela para o dia 31/08/2018
01/10/2018
01/11/2018


Quando modifico o seu DateTimerPicker do primeiro vencimento para
15/08/2018
O restante fica
14/11/2018
14/12/2018

Em vez de ficar
14/09/2018
15/10/2018
_________________
Jogo seu smartphone? Acesse o link e confira.
https://play.google.com/store/apps/details?id=br.com.couldsys.rockdrum
https://play.google.com/store/apps/details?id=br.com.couldsys.drumsetfree
Voltar ao Topo
Ver o perfil de Usuários Enviar Mensagem Particular
Mostrar os tópicos anteriores:   
Novo Tópico   Responder Mensagem    ActiveDelphi - Índice do Fórum -> Delphi Todos os horários são GMT - 3 Horas
Página 1 de 1

 
Ir para:  
Enviar Mensagens Novas: Proibido.
Responder Tópicos Proibido
Editar Mensagens: Proibido.
Excluir Mensagens: Proibido.
Votar em Enquetes: Proibido.


Powered by phpBB © 2001, 2005 phpBB Group
Traduzido por: Suporte phpBB