Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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;
- }
Add Comment
Please, Sign In to add comment