Download the PHP package anurat/laravel-thai-tax without Composer
On this page you can find all versions of the php package anurat/laravel-thai-tax. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-thai-tax
laravel-thai-tax
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.
After installed, it can be used through ThaiTax
facade.
Usage
The simplest use of the library is to provide netIncome()
(THB)
then call incomeTax()
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.
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
Also you can use more specific type of incomes
e.g. salary(float $salaryPerMonth)
or bonus(float $bonus)
.
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.
Deduction
For general type of deductions deduction()
can be used.
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)
// ช๊อปดีมีคืน
deduction()
can also accept an array as an argument.