anurat/laravel-thai-tax

1.0.6 2021-01-11 09:41 UTC

This package is auto-updated.

Last update: 2024-09-11 17:33:39 UTC


README

此 Laravel 扩展包允许您根据泰国法规计算个人所得税。

安装

已在 Laravel 8 上测试,但应适用于 Laravel 的任何版本。

composer require anurat/laravel-thai-tax

安装后,可以通过 ThaiTax 门面使用。

use ThaiTax;

用法

库的最简单用法是提供 netIncome()(泰铢)
然后调用 incomeTax()

ThaiTax::netIncome(500000)->incomeTax();
// 9500 THB

净收入是总收入减去总支出减去总扣除。
然后根据个人所得税率计算收入税
例如 https://www.rd.go.th/59670.html

泰国历年

您还可以提供泰国历年以计算不同年份的不同收入税,如下所示。

如果未提供泰国历年,则使用当前年份。

ThaiTax::thaiYear(2542)
    ->netIncome(500000)
    ->incomeTax();
// 42500 THB

它可以计算的最早年份是 2542 年

收入和扣除

可以通过使用收入和扣除来计算净收入
因此,可以提供收入和扣除而不是净收入。

netIncome() 和(所有类型的收入和扣除)不应同时使用,因为它们将相互覆盖。

收入

income(float $income) 可用于一般类型的收入

ThaiTax::thaiYear(2564)
    ->income(250000)
    ->income(50000)
    ->income(15000)
    ->incomeTax();
// 250 THB    

您还可以使用更具体的收入类型
例如 salary(float $salaryPerMonth)bonus(float $bonus)

ThaiTax::thaiYear(2564)
    ->income(100000)
    ->salary(50000)
    ->bonus(50000)
    ->incomeTax();
// 41000 THB    

salary() 接受月工资作为参数,因此 50,000 将是每年 600,000。

income(array $incomes) 也可以接受数组作为参数。

ThaiTax::thaiYear(2564)
    ->income([
        50000,
        50000,
        'salary' => 50000,
        'bonus' => 50000
    ])
    ->incomeTax();
// 41000 THB    

扣除

对于一般类型的扣除,可以使用 deduction()

ThaiTax::thaiYear(2564)
    ->income(500000)
    ->deduction(100000)
    ->incomeTax();
// 4500 THB    

其他扣除类型如下。
它具有检查该类型特定规则的优势
例如,房屋贷款利息可能不超过 100,000 泰铢
如果提供更多,则会自动减少到 100,000 泰铢。

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) // Shop Dee Mee Keun

ThaiTax::thaiYear(2564)
    ->income(1000000)
    ->spouse(true)
    ->children(2)
    ->parents(3)
    ->insurancePremium(50000)
    ->incomeTax();
// 39500 THB    

deduction() 也可以接受数组作为参数。

ThaiTax::thaiYear(2564)
    ->income(1000000)
    ->deduction([
        'spouse' => true,
        'children' => 2,
        'parents' => 3,
        'insurancePremium' => 50000
    ])
    ->incomeTax();
// 39500 THB