You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kwpayroll/app/ClassLib/PayrollComputation.php

41 lines
930 B
PHP

<?php
namespace App\ClassLib;
class PayrollComputation
{
public function __construct()
{
}
public function computeIncomeTax($grossTaxableIncome)
{
$tax = 0;
if($grossTaxableIncome <= 10417)
{
$tax = 0;
}
else if($grossTaxableIncome <= 16666)
{
$tax = ($grossTaxableIncome - 10417) * 0.2;
}
else if($grossTaxableIncome <= 33332)
{
$tax = (($grossTaxableIncome - 16667) * 0.25) + 1250;
}
else if($grossTaxableIncome <= 83332)
{
$tax = (($grossTaxableIncome - 33333) * 0.3) + 5416.67;
}
else if($grossTaxableIncome <= 333332)
{
$tax = (($grossTaxableIncome - 83333) * 0.32) + 20416.67;
}
else
{
$tax = (($grossTaxableIncome - 333333) * 0.35) + 100416.67;
}
return $tax;
}
}