hilinksnetworks / ng-paye-calculator
A simple PHP library for calculating PAYE in Nigeria.
dev-main
2024-11-17 14:58 UTC
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2024-11-17 14:58:45 UTC
README
A PHP library for calculating Pay As You Earn (PAYE) tax in Nigeria. This library computes PAYE based on the annual salary, an array of allowances, and an array of deductions using the Nigerian tax system.
Features
- Supports input of annual salary, allowances, and deductions.
- Automatically calculates total allowances and deductions.
- Computes PAYE using Nigeria's progressive tax brackets.
- Easy to integrate into any PHP project.
Installation
Install the library via Composer:
composer require hilinksnetworks/ng-paye-calculator
Usage
Here's how to use the PAYE Calculator in your PHP project:
require 'vendor/autoload.php'; use PAYE\PAYECalculator; // Input data $annualSalary = 5000000; // Annual Salary: ₦5,000,000 $allowances = [1000000, 500000, 250000]; // Array of allowances $deductions = [200000, 150000, 100000]; // Array of deductions // Calculate PAYE $paye = PAYECalculator::calculate($annualSalary, $allowances, $deductions); echo "The PAYE tax is: ₦" . number_format($paye, 2);
Explanation of Inputs
- Annual Salary: Total annual salary (numeric value).
- Allowances: An array of all allowances (e.g., housing, transport).
- Deductions: An array of all deductions (e.g., pension, insurance).
How PAYE is Calculated
The PAYE is computed using the following steps:
- Gross Income = Annual Salary + Total Allowances.
- Consolidated Relief Allowance (CRA):
- ₦200,000 or 1% of gross income (whichever is higher) + 20% of gross income.
- Taxable Income = Gross Income - (CRA + Total Deductions).
- Progressive Tax Rates:
- First ₦300,000: 7%
- Next ₦300,000: 11%
- Next ₦500,000: 15%
- Next ₦500,000: 19%
- Next ₦1,600,000: 21%
- Above ₦3,200,000: 24%
Requirements
- PHP 7.4 or higher.
- Composer.
License
This project is licensed under the MIT License.
Author
Your Name
Email: contact@hilinksnetworks.ng
GitHub: hilinksnetworks