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.