谁能帮我为我们的 Office 员工工资税表创建 PHP 或 mysql 代码。 这是我们税收监管的基础。
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
最佳答案
function get_taxed_salary($salary){
if ($salary <= 150 ){
return $salary;
};
if ($salary <= 650){
return ( 0.9 * $salary - 15.0 );
};
...
}
稍后在您的代码中您可以像这样使用该函数:
$taxed_salary = get_taxed_salary($salary);
关于php - 所得税计算的编程逻辑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8951553/