UNPKG

@dlivr.io/salary-calculator-egypt

Version:

Javascript SDK for calculating Net/Gross salary in Egypt.

164 lines (158 loc) 3.36 kB
import { million, thousand } from "@/helpers/utils"; import { Bracket, Law } from "@/data-source/types"; const FIRST_BRACKET: Bracket = { min: 1, max: thousand(600), stages: [ { min: thousand(40), max: thousand(55), percentage: 0.1, }, { min: thousand(55), max: thousand(70), percentage: 0.15, }, { min: thousand(70), max: thousand(200), percentage: 0.2, }, { min: thousand(200), max: thousand(400), percentage: 0.225, }, { min: thousand(400), max: Infinity, percentage: 0.25, }, ], }; const SECOND_BRACKET: Bracket = { min: thousand(600), max: thousand(700), stages: [ { min: 0, max: thousand(55), percentage: 0.1, }, { min: thousand(55), max: thousand(70), percentage: 0.15, }, { min: thousand(70), max: thousand(200), percentage: 0.2, }, { min: thousand(200), max: thousand(400), percentage: 0.225, }, { min: thousand(400), max: Infinity, percentage: 0.25, }, ], }; const THIRD_BRACKET: Bracket = { min: thousand(700), max: thousand(800), stages: [ { min: 0, max: thousand(70), percentage: 0.15, }, { min: thousand(70), max: thousand(200), percentage: 0.2, }, { min: thousand(200), max: thousand(400), percentage: 0.225, }, { min: thousand(400), max: Infinity, percentage: 0.25, }, ], }; const FOURTH_BRACKET: Bracket = { min: thousand(800), max: thousand(900), stages: [ { min: 0, max: thousand(200), percentage: 0.2, }, { min: thousand(200), max: thousand(400), percentage: 0.225, }, { min: thousand(400), max: Infinity, percentage: 0.25, }, ], }; //diff applied const FIFTH_BRACKET: Bracket = { min: thousand(900), max: million(1.2), stages: [ { min: 0, max: thousand(400), percentage: 0.225, }, { min: thousand(400), max: Infinity, percentage: 0.25, }, ], }; //diff applied const SIXTH_BRACKET: Bracket = { min: million(1.2), max: Infinity, stages: [ { min: 0, max: million(1.2), percentage: 0.25, }, { min: million(1.2), max: Infinity, percentage: 0.275, }, ], }; export const TWENTY_FOUR: Law = { brackets: [ FIRST_BRACKET, SECOND_BRACKET, THIRD_BRACKET, FOURTH_BRACKET, FIFTH_BRACKET, SIXTH_BRACKET, ], exemptionThreshold: thousand(20), MaxGrossSalary: 14500, MinGrossSalary: 2300, };