本文介绍了所得税计算的编程逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以帮助我为我们的Office员工薪水税表创建PHP或mysql代码的任何人.这是我们进行税收监管的基础.

Is any one who can help me to create PHP or mysql Code for our Office employee salary tax table.Here is the base for our tax regulation.

 If salary is >= 0 and <= 150 it will be 0% (Nill),
 If salary is >= 151 and <= 650 it will be 10% - 15.00,
 If salary is >= 651 and <= 1400 it will be 15% - 47.50,
 If salary is >= 1401 and <= 2350 it will be 20% -117.50,
 If salary is >= 2351 and <= 3550 it will be 25% - 235.00,
 If salary is >= 3551 and <= 5000 it will be 30% - 412.5,
 If salary is >= 5001 it will be 35% - 662.50

推荐答案

在大多数国家/地区,这不是税收的工作原理-您不必根据收入多少按一定百分比纳税.如果真是这样,那么那些工资刚好高于税率的人税后的净收入将低于收入低于税率的人.

In most countries, that is not how tax works - you don't pay tax at a certain percent based on how much you earn. If that was the case then people who's wages were just above a tax bracket would have a net income after tax lower than someone who earnt just under a tax bracket.

它的实际运作方式:对于收入的每个部分(属于每个税种),您将以不同的百分比缴税.因此,如果您的收入为$ 11,000,并且税级从0到10,000,另一个税级从10,000到20,000,则所赚取的前10k将按第一个支架的税率征税,其余的1000k将按第二个税率的较高税率征税括号.

How it really works: you pay tax at different percentages, for each part of your income that falls within each tax bracket. So if you earn $11,000 and there is a tax bracket from 0 to 10,000 and another from 10,000 up to 20,000 then the first 10k earned will be taxed at the first bracket's rate and the remaining 1k will be taxed at the higher rate of the second tax bracket.

以这种方式计算税收的代码:

Code to calculate tax in this manner:

//the tops of each tax band
$band1_top = 14000;
$band2_top = 48000;
$band3_top = 70000;
//no top of band 4

//the tax rates of each band
$band1_rate = 0.105;
$band2_rate = 0.175;
$band3_rate = 0.30;
$band4_rate = 0.33;

$starting_income = $income = 71000; //set this to your income

$band1 = $band2 = $band3 = $band4 = 0;

if($income > $band3_top) {
    $band4 = ($income - $band3_top) * $band4_rate;
    $income = $band3_top;
}

if($income > $band2_top) {
    $band3 = ($income - $band2_top) * $band3_rate;
    $income = $band2_top;
}

if($income > $band1_top) {
    $band2 = ($income - $band1_top) * $band2_rate;
    $income = $band1_top;
}

$band1 = $income * $band1_rate;

$total_tax_paid = $band1 + $band2 + $band3 + $band4;

echo "Tax paid on $starting_income is $total_tax_paid";

?>

这篇关于所得税计算的编程逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 23:05