Advertisement
bousaid

IRG 2022 Delphi

May 23rd, 2022 (edited)
1,024
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.40 KB | None | 0 0
  1. {
  2.   IRG 2022 Function By Boussaid Mustafa
  3.   APC SALI 2022
  4.   Usage:
  5.   //Normal
  6.   Edit2.Text:=FormatFloat('# ##0.00',IRG2022New(StrToFloat(Edit1.Text),1));
  7.   //Handicape
  8.   Edit2.Text:=FormatFloat('# ##0.00',IRG2022New(StrToFloat(Edit1.Text),2));
  9. }
  10. Function IRG2022New(soumis: real;TypeIrg:integer) : real;
  11. var
  12.    T00,T01,T02,T03,T04: integer;
  13.    irg, abat, p: real;
  14.  
  15. begin
  16.      T00:= 20000;
  17.      T01:= 4600;
  18.      T02:= 10800;
  19.      T03:= 24000;
  20.      T04:= 52800;
  21.      p := (Int(soumis / 10)) * 10;
  22.  
  23.      if (soumis > 30009) And (soumis <= 40000) then irg := (p - T00) * 0.23
  24.      else if (soumis > 40000) And (soumis <= 80000) then irg := (P - 40000) * 0.27 + T01
  25.      else if (soumis > 80000) And (soumis <= 160000) then irg := (P - 80000) * 0.30 + T01 + T02
  26.      else if (soumis > 160000) And (soumis <= 320000) then irg := (P - 160000) * 0.33 + T01 + T02 + T03
  27.      else Irg := (P - 320000) * 0.35  + T01 + T02 + T03 + T04;
  28.  
  29.      abat := irg * 0.4;
  30.      If abat < 1000 then abat := 1000;
  31.      If abat > 1500 then abat := 1500;
  32.      irg := irg - abat;
  33.  
  34.      // 1= Normal 2= Handicape
  35.      if TypeIrg = 1 then begin   //---->Normal
  36.       if soumis < 35000 then irg := (irg * 137/51) - (27925/8)
  37.      end
  38.      else begin    //---->Handicape
  39.       if soumis < 42500 then irg := (irg * 93/61) - (81213/41)
  40.      end;
  41.  
  42.      if soumis < 30010 then irg := 0;
  43.      Result:= RoundTo(irg, -1);
  44. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement