anurat/laravel-thai-tax
Composer 安装命令:
composer require anurat/laravel-thai-tax
包简介
Thai tax calculation
README 文档
README
This Laravel package allows you to calculate personal income tax according to Thai regulations.
Installation
Tested on Laravel 8 but should be working on any version of Laravel.
composer require anurat/laravel-thai-tax
After installed, it can be used through ThaiTax facade.
use ThaiTax;
Usage
The simplest use of the library is to provide netIncome() (THB)
then call incomeTax()
ThaiTax::netIncome(500000)->incomeTax(); // 9500 THB
Net income is total incomes minus total expenses minus total deductions.
It is then used to calculate income tax according to personal income tax rate
e.g. https://www.rd.go.th/59670.html
Thai year
You can also provide Thai year to calculate different income tax on different year as follow.
If Thai year is not provided, the current year is used.
ThaiTax::thaiYear(2542) ->netIncome(500000) ->incomeTax(); // 42500 THB
The earliest year it can calculate is 2542
Incomes and Deductions
Net income can be calculated by using incomes and deductions,
so incomes and deductions can be provided instead of net income.
netIncome()and (all types or incomes and deductions) should not be used together, as they will override each other.
Income
income(float $income) can be used for general type of incomes
ThaiTax::thaiYear(2564) ->income(250000) ->income(50000) ->income(15000) ->incomeTax(); // 250 THB
Also you can use more specific type of incomes
e.g. salary(float $salaryPerMonth) or bonus(float $bonus).
ThaiTax::thaiYear(2564) ->income(100000) ->salary(50000) ->bonus(50000) ->incomeTax(); // 41000 THB
salary() takes monthly salary as an argument so 50,000 will be 600,000 per year.
income(array $incomes) can also accept an array as an argument.
ThaiTax::thaiYear(2564) ->income([ 50000, 50000, 'salary' => 50000, 'bonus' => 50000 ]) ->incomeTax(); // 41000 THB
Deduction
For general type of deductions deduction() can be used.
ThaiTax::thaiYear(2564) ->income(500000) ->deduction(100000) ->incomeTax(); // 4500 THB
Other deduction types are as follow.
It has the benefit of checking for specific rules for that type
e.g. home loan interest may not exceed 100,000 Baht,
it will automatically reduce to 100,000 Baht if more is provided.
spouse(bool $hasSpouse) // คู่สมรส
children(int $noOfChildren) // บุตร
parents(int $noOfParents) // บิดามารดา
disabiltites(int $noOfDisabilities) // ผู้พิการ/ทุพพลภาพ
childBirth(float $cost) // ฝากครรภ์และทำคลอด
insurancePremium(float $premium) // ประกันชีวิต
annuityInsurancePremium(float $premium) // ประกันชีวิตแบบบำนาญ
homeLoanInterest(float $interest) // ดอกเบี้ยซื้อที่อยู่อาศัย
providentFund(float $fund) // กองทุนสำรองเลี้ยงชีพ
socialSecurity(float $security) // ประกันสังคม
donation(float $donation) // บริจาค
educationDonation(float $donation) // บริจาคเพื่อการศึกษา/กีฬา
politicalParty(float $donation) // บริจาคพรรคการเมือง
shopDeeMeeKeun(float $shop) // ช๊อปดีมีคืน
ThaiTax::thaiYear(2564) ->income(1000000) ->spouse(true) ->children(2) ->parents(3) ->insurancePremium(50000) ->incomeTax(); // 39500 THB
deduction() can also accept an array as an argument.
ThaiTax::thaiYear(2564) ->income(1000000) ->deduction([ 'spouse' => true, 'children' => 2, 'parents' => 3, 'insurancePremium' => 50000 ]) ->incomeTax(); // 39500 THB
anurat/laravel-thai-tax 适用场景与选型建议
anurat/laravel-thai-tax 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 01 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 anurat/laravel-thai-tax 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 anurat/laravel-thai-tax 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-09