- المبرمج
- بوسعيد مصطفى
- متطلبات التشغيل
- كافة نظم التشغيل
- هاتف المبرمج
- 049.97.31.28
- بريد التواصل
- bousali@gmail.com
السلام عليكم
دالة حساب الضريبة IRG 2020-2022 للاستخدام الجاهز و الحساب التلقائي مع أشهر لغات البرمجة (عادي + ذوي الاحتياجات الخاصة)
و يمكن استخدامها مع اللغات التالية:
VBA
VB. NET
Windev
C#
Python
Delphi
VB. NET
Windev
C#
Python
Delphi
الضريبة و صيغتها
Exemple dans MS Excel:
=IRG2022_New(1;رقم الخلية)
=IRG2022_New(2;رقم الخلية)
(Excel & Access) VBA, VB.NET IRG 2022
VBA:
' =================================================================================================
' IRG 2022 Function By Boussaid Mustafa |
' APC SALI 2022 |
' Normal + Handicape |
' Usage: |
'---->Normal |
' =IRG2022_New(1;A1) |
'---->Handicape |
' =IRG2022_New(2;A1) |
' =================================================================================================
Function IRG2022_New(TypeIRG, moTr) As Double
moTr = Int(moTr / 10) * 10
If moTr <= 30000 Then
IRG2022_New = 0
Else
Select Case moTr
Case 30010 To 40000: IRG2022_New = (moTr - 20000) * 0.23
Case 40001 To 80000: IRG2022_New = 4600 + (moTr - 40000) * 0.27
Case 80001 To 160000: IRG2022_New = 15400 + (moTr - 80000) * 0.3
Case 160001 To 320000: IRG2022_New = 39400 + (moTr - 160000) * 0.33
Case Is > 320000: IRG2022_New = 92200 + (moTr - 320000) * 0.35
Case Else: IRG2022_New = 0
End Select
Dim abat As Double
abat = IRG2022_New * 0.4
If abat < 1000 Then abat = 1000
If abat > 1500 Then abat = 1500
IRG2022_New = IRG2022_New - abat
'1= Normal 2= Handicape
Select Case TypeIRG
Case 1 '---->Normal
If moTr <= 35000 Then
IRG2022_New = (IRG2022_New * 137 / 51) - (27925 / 8)
End If
Case 2 '---->Handicape
If moTr < 42500 Then
IRG2022_New = (IRG2022_New * 93 / 61) - (81213 / 41)
End If
End Select
End If
IRG2022_New = Round(IRG2022_New, 1)
End Function
(Excel & Access) VBA IRG 2020
VBA:
' IRG 2020 Function By Boussaid Mustafa
' APC SALI 2020
Function IRG_New(moTr)
moTr = (Int(moTr / 10)) * 10
Select Case moTr
Case Is < 30000: IRG_New = 0
Case 30000 To 35000: IRG_New = (moTr - 30000) * 0.8
Case 35000 To 120000: IRG_New = 2500 + ((moTr - 30000) / 10) * 3
Case Is > 120000: IRG_New = 29500 + ((moTr - 120000) / 10) * 3.5
End Select
End Function
WINDEV IRG PROCEDURE
مثال الاستخدام:
Exemple Usage:
//Normal
SAI_irg = IRG_2022(1,SAI_Brut)
//Handicape
SAI_irg = IRG_2022(2,SAI_Brut)
الجنوب الكبير:
Grand Sud:
SAI_Irg = IRG_2022(1,SAI_Brut)/2
PROCEDURE IRG 2022
WINDEV:
// IRG 2022 PROCEDURE By Boussaid Mustafa
// APC SALI 2022
//Usage:
//Normal
//SAI_irg = IRG_2022(1,SAI_Brut)
//Handicape
//SAI_irg = IRG_2022(2,SAI_Brut)
PROCEDURE IRG_2022(Type_IRG is int, Soumis)
rIrg is real
p is real = IntegerPart(Soumis/10)*10
IF (Soumis <= 30000 ) THEN
rIrg = 0
ELSE
SWITCH Soumis
CASE 30010 TO 40000 : rIrg = (p - 20000) * 0.23
CASE 40000 TO 80000: rIrg = 4600 + (p - 40000) * 0.27
CASE 80000 TO 160000: rIrg = 15400 + (p - 80000) * 0.3
CASE 160000 TO 320000: rIrg = 39400 + (p - 160000) * 0.33
OTHER CASE: rIrg = 92200 + (p - 320000) * 0.35
END
Abat is real = rIrg * 0.4
IF Abat < 1000 THEN Abat = 1000
IF Abat > 1500 THEN Abat = 1500
rIrg = rIrg - Abat
// 1= Normal 2= Handicape
SWITCH Type_IRG
CASE 1 //---->Normal
IF Soumis <= 35000 THEN
rIrg = (rIrg * 137/51)-(27925/8)
END
CASE 2 //---->Handicape
IF Soumis < 42500 THEN
rIrg = (rIrg * 93/61)-(81213/41)
END
OTHER CASE
END
END
rIrg = Round(rIrg,1)
RESULT rIrg
PROCEDURE IRG 2020
WINDEV:
// IRG 2020 PROCEDURE By Boussaid Mustafa
// APC SALI 2020
PROCEDURE irg_2020(i is currency)
cyIrgn is currency
p is currency = IntegerPart((IntegerPart(i))/10)*10
SWITCH i
CASE < 30000: cyIrgn = 0
CASE 30000 TO 35000: cyIrgn = (p - 30000) * 0.8
CASE 35000 TO 120000: cyIrgn = 2500 + ((p - 30000) / 10) * 3
OTHER CASE: cyIrgn = 29500 + ((p - 120000) / 10) * 3.5
END
RESULT IntegerPart(cyIrgn)
C# IRG Class
C# IRG Class
C#:
//C# IRG 2022 By BOUSSAID Mustafa 2022
public static double IRG2022New(int TypeIRG, double Soumis)
{
//Variables
const int T00 = 20000;
const int T01 = 4600;
const int T02 = 10800;
const int T03 = 24000;
const int T04 = 52800;
double Irg = 0;
double P = Math.Floor(Soumis / 10) * 10;
if (Soumis <= 30009)
{
Irg = 0;
}
else
{
if (Soumis >= 30010 && Soumis <= 40000) { Irg = (P - T00) * 0.23; }
else if (Soumis > 40000 && Soumis <= 80000) { Irg = (P - 40000) * 0.27 + T01; }
else if (Soumis > 80001 && Soumis <= 160000) { Irg = (P - 80000) * 0.30 + T01 + T02; }
else if (Soumis > 160001 && Soumis <= 320000) { Irg = (P - 160000) * 0.33 + T01 + T02 + T03; }
else if (Soumis > 320000) { Irg = (P - 320000) * 0.35 + T01 + T02 + T03 + T04; }
double Abat = Irg * 0.4;
if (Abat < 1000) { Abat = 1000; }
else if (Abat > 1500) { Abat = 1500; }
Irg -= Abat;
// 1= Normal 2= Handicape
switch (TypeIRG)
{
case 1: //---->Normal
if (Soumis < 35000) { Irg = (Irg * 137d / 51d) - (27925d / 8d); }
break;
case 2: //---->Handicape
if (Soumis < 42500) { Irg = (Irg * 93d / 61d) - (81213d / 41d); }
break;
default:
//Irg = Math.Round(Irg, 1);
break;
}
Irg = Math.Round(Irg, 1);
}
return Irg;
}
Delphi IRG Function
Delphi IRG Function
Delphi IRG2022:
{
IRG 2022 Function By Boussaid Mustafa
APC SALI 2022
Usage:
//Normal
Edit2.Text:=FormatFloat('# ##0.00',IRG2022New(StrToFloat(Edit1.Text),1));
//Handicape
Edit2.Text:=FormatFloat('# ##0.00',IRG2022New(StrToFloat(Edit1.Text),2));
}
Function IRG2022New(soumis: real;TypeIrg:integer) : real;
var
T00,T01,T02,T03,T04: integer;
irg, abat, p: real;
begin
T00:= 20000;
T01:= 4600;
T02:= 10800;
T03:= 24000;
T04:= 52800;
p := (Int(soumis / 10)) * 10;
if (soumis > 30009) And (soumis <= 40000) then irg := (p - T00) * 0.23
else if (soumis > 40000) And (soumis <= 80000) then irg := (P - 40000) * 0.27 + T01
else if (soumis > 80000) And (soumis <= 160000) then irg := (P - 80000) * 0.30 + T01 + T02
else if (soumis > 160000) And (soumis <= 320000) then irg := (P - 160000) * 0.33 + T01 + T02 + T03
else Irg := (P - 320000) * 0.35 + T01 + T02 + T03 + T04;
abat := irg * 0.4;
If abat < 1000 then abat := 1000;
If abat > 1500 then abat := 1500;
irg := irg - abat;
// 1= Normal 2= Handicape
if TypeIrg = 1 then begin //---->Normal
if soumis < 35000 then irg := (irg * 137/51) - (27925/8)
end
else begin //---->Handicape
if soumis < 42500 then irg := (irg * 93/61) - (81213/41)
end;
if soumis < 30010 then irg := 0;
Result:= RoundTo(irg, -1);
end;
Python IRG Function
Python IRG2022:
# IRG 2022 Function By BOUSSAID MUSTAFA
# APC SALI ADRAR 2022
from math import floor
def irg_2022(typeirg, soumis):
t00 = 20000
t01 = 4600
t02 = 10800
t03 = 24000
t04 = 52800
p = floor(soumis / 10) * 10
if soumis <= 30009:
irg = 0
else:
if 30010 <= soumis <= 40000:
irg = (p - t00) * 0.23
elif 40000 < soumis <= 80000:
irg = (p - 40000) * 0.27 + t01
elif 80001 < soumis <= 160000:
irg = (p - 80000) * 0.30 + t01 + t02
elif 160001 < soumis <= 320000:
irg = (p - 80000) * 0.33 + t01 + t02 + t03
elif soumis > 320000:
irg = (p - 320000) * 0.35 + t01 + t02 + t03 + t04
else:
irg = 0
abat = irg * 0.4
if abat < 1000:
abat = 1000
elif abat > 1500:
abat = 1500
irg -= abat
match typeirg:
case 1: # ---->Normal
if soumis < 35000:
irg = (irg * 137 / 51) - (27925 / 8)
case 2: # ---->Handicape
if soumis < 42500:
irg = (irg * 93 / 61) - (81213 / 41)
irg = round(irg, 1)
return irg
# Resulta
#x = irg_2022(1, 67203.45)
#print(x)