Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Impresión (https://www.clubdelphi.com/foros/forumdisplay.php?f=4)
-   -   Hola hacer calculo con el esedente de dos cantidades (https://www.clubdelphi.com/foros/showthread.php?t=62825)

esimon 16-01-2009 02:47:57

Hola hacer calculo con el esedente de dos cantidades
 
Saludo para todo, estoy haciendo un reporte, en el cual tengo que hacer un descuento al esedente entre dos cantidades, o sueldo y esto es lo que estoy haciendo.
Código:

procedure TFrm_Reporte_de_Nomina.ppVariable7Print(Sender: TObject);
begin
          ppVariable6.Value := ppVariable6.Value * 12;
      if (ppVariable6.Value >= 330301.00) or (ppVariable6.Value <= 495450.00) then begin
          ppVariable8.Value := 495450.00 - 330301.00;
          ppVariable8.Value := ppVariable8.Value - (ppVariable1.Value - ppVariable2.Value);
          ppVariable7.Value := ppVariable8.Value * 15/100;
          ppVariable7.Value := ppVariable7.Value / 12;
          ppVariable6.Value := ppVariable6.Value / 12;
          end
      else
      if (ppVariable6.Value >= 495450.01) or (ppVariable6.Value <= 688125.00) then begin
          ppVariable8.Value := 688125.00 - 495450.01;
        //  ppVariable8.Value := ppVariable8.Value - (ppVariable1.Value - ppVariable2.Value);
          ppVariable7.Value := ppVariable8.Value * 20/100;
          ppVariable7.Value := ppVariable7.Value / 12;
          ppVariable6.Value := ppVariable6.Value / 12;
          end
      else
      if (ppVariable6.Value > 688125.00)  then begin
      //    ppVariable8.Value := ppVariable8.Value - (ppVariable1.Value - ppVariable2.Value);
          ppVariable7.Value := ppVariable8.Value * 25/100;
          ppVariable7.Value := ppVariable7.Value / 12;
          ppVariable6.Value := ppVariable6.Value / 12;
          end;
end;
end.

para hacer ese calculo tengo que saber el sueldo anual de cada empleado y determinar que el sueldo es mayor o igual de 330301.00 y menor o igual que 495450.00, al esedente de eso dos tope restarle, ppVariable1.Value - ppVariable2.Value la cuales son dos descuento y el resultado de esa resta aplicarle un 15% y asi sucesivamente.

uso delphi 7 y accesse y para el reporte uso ReportBuilder.

duilioisola 16-01-2009 11:29:24

Cita:

determinar que el sueldo es mayor o igual de 330301.00 y menor o igual que 495450.00
Código Delphi [-]
procedure TFrm_Reporte_de_Nomina.ppVariable7Print(Sender: TObject);
begin
           ppVariable6.Value := ppVariable6.Value * 12;
       if (ppVariable6.Value >= 330301.00) AND (ppVariable6.Value <= 495450.00) then begin
           ppVariable8.Value := 495450.00 - 330301.00;
           ppVariable8.Value := ppVariable8.Value - (ppVariable1.Value - ppVariable2.Value);
           ppVariable7.Value := ppVariable8.Value * 15/100;
           ppVariable7.Value := ppVariable7.Value / 12;
           ppVariable6.Value := ppVariable6.Value / 12;
          end
       else
       if (ppVariable6.Value >= 495450.01) AND (ppVariable6.Value <= 688125.00) then begin
           ppVariable8.Value := 688125.00 - 495450.01;
        //   ppVariable8.Value := ppVariable8.Value - (ppVariable1.Value - ppVariable2.Value);
           ppVariable7.Value := ppVariable8.Value * 20/100;
           ppVariable7.Value := ppVariable7.Value / 12;
           ppVariable6.Value := ppVariable6.Value / 12;
           end
       else
       if (ppVariable6.Value > 688125.00)  then begin
       //    ppVariable8.Value := ppVariable8.Value - (ppVariable1.Value - ppVariable2.Value);
           ppVariable7.Value := ppVariable8.Value * 25/100;
           ppVariable7.Value := ppVariable7.Value / 12;
           ppVariable6.Value := ppVariable6.Value / 12;
           end;
end;
end.

duilioisola 16-01-2009 11:31:07

Si el código es Delphi, utiliza los tags [ DELPHI ] y [ / DELPHI ] para encerrar el código.
De eta forma se ve mejor y se resaltan las palabras reservadas.

esimon 22-01-2009 19:12:38

Mil gracias duilioisola, por la informacion y disculpa por no haber usado la etiqueta correspondiente.

pasa un feliz reto del día.

Ñuño Martínez 23-01-2009 09:41:47

Disculpa, pero, ¿qué significa esedente? ¿Excedente? Si es así, ¿cuál es el "excedente entre dos cantidades"? Es que no lo entiendo.


La franja horaria es GMT +2. Ahora son las 21:58:15.

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