السلام عليكم
لا تقلق يا أخي هاك مبتغاك ولا نسألك سوى الدعاء الصالح
IRG 2008
implementation
{$R *.DFM}
Function IRG2008(soumis:Real) : real;
var
TRS : array [0..5] of Real;
Tax : array [0..5] of Real;
Impan : array [0..5] of Real;
brts,taux,tb,n,td,impota,impm,abat,ret,RTS1 :real;
ill :integer;
begin
soumis := (Int(soumis / 10)) * 10;
TRS[1] := 0;
TRS[2] := 120000;
TRS[3] := 360000;
TRS[4] := 1440000;
TRS[5] := 9999999;
Tax[1] := 0;
Tax[2] := 0;
Tax[3] := 20;
Tax[4] := 30;
Tax[5] := 35;
Impan[1] := 0;
Impan[2] := 0;
Impan[3] := 48000;
Impan[4] := 372000;
Impan[5] := 3367999.65;
brts := soumis * 12;
ill := 1;
While (ill <= 5) and (brts >TRS[ill]) do ill := ill + 1;
taux := Tax[ill];
ill := ill - 1;
tb := TRS[ill];
td := Impan[ill];
n := brts - tb;
impota := (n * taux / 100) + td;
impm := impota / 12;
abat := (40 * impm / 100);
If abat < 1000 Then abat := 1000;
If abat > 1500 Then abat := 1500;
ret := impm - abat;
If ret < 0 Then ret := 0;
RTS1 := (ret * 10);
RTS1 := Int(RTS1);
RTS1 := RTS1 / 10;
IRG2008 := RTS1;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
edit2.Text := Floattostrf(irg2008(strtoFloat(edit1.text)),ffnumb er,18,2);
end;