Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > Varios
Register FAQ Members List Calendar Guía de estilo Search Today's Posts Mark Forums Read

Coloboración Paypal con ClubDelphi

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 11/06/2018
benegas benegas is offline
Registrado
NULL
 
Join Date: Jun 2018
Posts: 5
Poder: 0
benegas Va por buen camino
aqui tienes el codigo completo. tambien pense en os separador decimal, pero no lo estoy usando. ybual da em mismo error

Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    MaskEdit1: TMaskEdit;
    Label4: TLabel;
    Combo1: TComboBox;
    Label5: TLabel;
    cotiza: TEdit;
    Label6: TLabel;
    lista: TListBox;
    lista2: TListBox;
    GroupBox1: TGroupBox;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    encomienda: TEdit;
    viatico: TEdit;
    gastoadm: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Label7: TLabel;
    total: TEdit;
    GroupBox2: TGroupBox;
    radio1: TRadioButton;
    Radio2: TRadioButton;
    GroupBox3: TGroupBox;
    Label8: TLabel;
    Label9: TLabel;
    descuento: TEdit;
    incremento: TEdit;
    Label10: TLabel;
    Label11: TLabel;
    tp: TEdit;
    tpotra: TEdit;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    procedure CheckBox2Click(Sender: TObject);
    procedure CheckBox3Click(Sender: TObject);
    procedure Combo1Change(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure radio1Click(Sender: TObject);
    procedure Radio2Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
valor: string;
i: integer;
begin
i:=1;
  while (i<=4) do
    begin
      valor:=inputbox('Productos','Ingrese Productos','Ingresar');
      lista.items.add(valor);
      i:= i+1;
      end;

end;

procedure TForm1.Button6Click(Sender: TObject);
begin
if application.MessageBox('DESEA SALIR ?',
  'ATENCION !!!', MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2) = IDYES THEN
  close;
end;

procedure TForm1.Button3Click(Sender: TObject);
var
num: string;
var
  s, pre: real;
i:integer;
begin
i:= 1;
  while (i<=4) do
    begin
      num:=inputbox('Precio','Ingrese Precio','Ingresar');
      lista2.Items.Add(num);
      pre:= strtofloat(num);
      s:= s+pre;
      i:= i+1;
      end;
      total.text:= floattostr(s);

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if lista.ItemIndex= -1 then
  begin
  showmessage('Seleccionar un Item');
  exit;
  end;
  lista.Items.Delete(lista.ItemIndex);
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
if lista2.ItemIndex= -1 then
  begin
  showmessage('Seleccionar un Item');
  exit;
  end;
  lista2.Items.Delete(lista2.ItemIndex);
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
var
  e:real;
begin
  if CheckBox1.checked = true then
    begin
      e:=30000;
      encomienda.Color:=clWhite;
      encomienda.text:=floattostr(e);

    end
  else if CheckBox1.checked = false then
    begin
      encomienda.Color:=clYellow;
      encomienda.text:=' ';
    end;

end;

procedure TForm1.CheckBox2Click(Sender: TObject);
var
  v:real;
begin
  if CheckBox2.checked = true then
    begin
      v:=50000;
      viatico.Color:=clWhite;
      viatico.text:=floattostr(v);

    end
  else if CheckBox2.checked = false then
    begin
      viatico.Color:=clYellow;
      viatico.text:='';
    end;

end;

procedure TForm1.CheckBox3Click(Sender: TObject);
var
  g:real;
begin
  if CheckBox3.checked = true then
    begin
      g:=10000;
      gastoadm.Color:=clWhite;
      gastoadm.text:=floattostr(g);
    end
  else if CheckBox3.checked = false then
    begin
      gastoadm.Color:=clYellow;
      gastoadm.text:='';
    end;
end;

procedure TForm1.Combo1Change(Sender: TObject);
var
  n:integer;
begin
  n:= combo1.ItemIndex;
  if (n = 0) then
    cotiza.Text:= '5500';
  if (n = 1) then
    cotiza.Text:= '1500';

end;

procedure TForm1.Button5Click(Sender: TObject);
begin
  combobox1.Text:= ' ';
  combobox2.Text:= ' ';
  maskedit1.Text:= ' ';
  combo1.Text:= ' ';
  cotiza.Text:= ' ';
  lista.clear;
  lista2.clear;
  CheckBox1.Checked := false;
  CheckBox2.Checked := false;
  CheckBox3.Checked := false;
  radio1.checked := true;
  radio2.checked := false;
  total.text:= ' ';
  descuento.Text:= ' ';
  incremento.text:= ' ';
  tp.Text:= ' ';
  tpotra.Text:= ' ';
  combobox1.SetFocus;
end;

procedure TForm1.radio1Click(Sender: TObject);
begin
  if (radio1.Checked=true) then
    begin
      descuento.Enabled:= true;
      descuento.Color:=clWhite;
      incremento.enabled:= false;
      incremento.Color:=clYellow;
      end;
end;

procedure TForm1.Radio2Click(Sender: TObject);
begin
  if (radio2.Checked=true) then
    begin
      descuento.Enabled:= false;
      descuento.Color:=clYellow;
      incremento.Enabled:= true;
      incremento.Color:=clWhite;
      end;
end;

procedure TForm1.Button7Click(Sender: TObject);
var
  a,b,c,tpro,des,cot,inc,tpom,t,tpgs:real;
begin
  des:=strtofloat (descuento.text);
  inc:=strtofloat(incremento.Text);
  a:=strtofloat(encomienda.text);
  b:=strtofloat(viatico.text);
  c:=strtofloat(gastoadm.text);
  tpro:=strtofloat(total.text);
  t:= a+b+c+tpro;

  if (descuento.Enabled=true) then
  
    tpgs:= t-des;

  if(incremento.enabled=true) then
   begin
    tpgs:= t+inc;
   end;
  
  tp.text:= floattostr(tpgs);
  cot:= strtofloat(cotiza.text);
  tpom:= tpgs/cot;
  tpotra.text:=floattostr(tpom);
  
end;

end.
Reply With Quote
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
is not a valid floating point angelratza Varios 2 20/06/2017 23:00
''not a valid floating point value Ian_Martinez Varios 7 20/02/2015 16:32
is not a valid floating point value donpedro Varios 6 22/11/2012 16:58
is not a valid floating point value ale_metall SQL 5 24/05/2008 16:44
1,253 is not valid floating point value soyhugo Varios 7 14/02/2004 05:40


All times are GMT +2. The time now is 14:03.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi