|
|
if( $_REQUEST['taxcode'] == '' ){
switch( $_REQUEST['year'] ){
case '2004':
$allowance = 4745;
break;
case '2005':
$allowance = 4895;
break;
case '2006':
$allowance = 5035;
break;
case '2007':
$allowance = 5225;
break;
case '2008':
$allowance = 6035;
break;
case '2009':
$allowance = 6475;
break;
}
} else {
$allowance = $_REQUEST['taxcode'];
}
switch( $_REQUEST['year'] ){
case '2004':
$basic = 2020;
$high = 31400;
$startingrate = 0.10;
$basicrate = 0.22;
$highrate = 0.40;
break;
case '2005':
$basic = 2090;
$high = 32400;
$ni_thr = 4888;
$ni_uel = 32760;
$startingrate = 0.10;
$basicrate = 0.22;
$highrate = 0.40;
break;
case '2006':
$basic = 2150;
$high = 33300;
$ni_thr = 5044;
$ni_uel = 33540;
$startingrate = 0.10;
$basicrate = 0.22;
$highrate = 0.40;
break;
case '2007':
$basic = 2230;
$high = 34600;
$ni_thr = 52*100;
$ni_uel = 52*670;
$startingrate = 0.10;
$basicrate = 0.22;
$highrate = 0.40;
break;
case '2008':
$basic = 2320;
$high = 34600;
$ni_thr = 52*105;
$ni_uel = 52*770;
$startingrate = 0.20;
$basicrate = 0.20;
$highrate = 0.40;
break;
case '2009':
$basic = 2440;
$high = 37400;
$ni_thr = 52*110;
$ni_uel = 52*844;
$startingrate = 0.20;
$basicrate = 0.20;
$highrate = 0.40;
break;
}
if($_REQUEST['paid'] == 'on'){
$weeks = 48;
} else {
$weeks = 52;
}
switch( $_REQUEST['period'] ){
case 'yearly':
$gross = $_REQUEST['gross'];
break;
case 'monthly':
$gross = $_REQUEST['gross']*12;
break;
case 'weekly':
$gross = $_REQUEST['gross']*$weeks;
break;
case 'hourly':
$gross = $_REQUEST['gross']*($weeks*$hoursinweek);
break;
}
if( $gross <= $allowance ){
$tax = 0;
} elseif( $gross <= $allowance + $basic ){
$tax = ($gross - $allowance) * $startingrate;
} elseif( $gross <= $allowance + $high ){
$tax = ($gross - $allowance - $basic) * $basicrate + ($basic * $startingrate);
} else {
$tax = ($gross - $allowance - $high) * $highrate + ($high-$basic) * $basicrate + ($basic * $startingrate);
}
if( $gross <= $ni_uel ){
$ni = ($gross - $ni_thr) * 0.11;
} else {
$ni = ($gross - $ni_uel) * 0.01 + (($ni_uel-$ni_thr) * 0.11);
}
if( $gross - $allowance > 0 ){
$taxable = $gross - $allowance;
} else {
$taxable = 0;
$tax = 0;
}
if( $gross <= $ni_thr ){
$ni = 0;
}
//TODO
if( isset($_REQUEST['holiday']) ){
$holiday = $_REQUEST['holiday'];
} else {
$holiday = 0;
}
if( isset($_REQUEST['paidbankhol']) ){
$paidbankhol = $_REQUEST['paidbankhol'];
} else {
$paidbankhol = 'Y';
}
?>
|
| Pay: | Yearly | Monthly | Weekly | Hourly |
| Gross: |
print( number_format($gross, 2, '.', '') ); ?> |
print( number_format(($gross)/12, 2, '.', '') ); ?> |
print( number_format(($gross)/$weeks, 2, '.', '') ); ?> |
print( number_format(($gross)/($weeks*$hoursinweek), 2, '.', '') ); ?> |
| Taxable: |
print( number_format($taxable, 2, '.', '') ); ?> |
print( number_format($taxable/12, 2, '.', '') ); ?> |
print( number_format($taxable/$weeks, 2, '.', '') ); ?> |
print( number_format($taxable/($weeks*$hoursinweek), 2, '.', '') ); ?> |
| Tax: |
print( number_format($tax, 2, '.', '') ); ?> |
print( number_format($tax / 12, 2, '.', '') ); ?> |
print( number_format($tax / $weeks, 2, '.', '') ); ?> |
print( number_format($tax / ($weeks*$hoursinweek), 2, '.', '') ); ?> |
| NI: |
print( number_format($ni, 2, '.', '') ); ?> |
print( number_format($ni / 12, 2, '.', '') ); ?> |
print( number_format($ni / $weeks, 2, '.', '') ); ?> |
print( number_format($ni / ($weeks*$hoursinweek), 2, '.', '') ); ?> |
| Net: |
print( number_format($gross - $tax - $ni, 2, '.', '') ); ?> |
print( number_format(($gross - $tax - $ni ) / 12, 2, '.', '') ); ?> |
print( number_format(($gross - $tax - $ni ) / $weeks, 2, '.', '') ); ?> |
print( number_format(($gross - $tax - $ni ) / ($weeks*$hoursinweek), 2, '.', '') ); ?> |
|