gpt4 book ai didi

php - 所得税计算的编程逻辑

转载 作者:可可西里 更新时间:2023-11-01 08:07:24 26 4
gpt4 key购买 nike

谁能帮我为我们的 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com