fiscfree/dutch-tax-income-calculator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fiscfree/dutch-tax-income-calculator

Composer 安装命令:

composer require fiscfree/dutch-tax-income-calculator

包简介

Framework-agnostic Dutch Tax Income Calculator - Calculate Dutch income tax, social security contributions, and tax credits

README 文档

README

PHP Version License

A framework-agnostic PHP 8.4+ library for calculating Dutch income tax, social security contributions and tax credits. This package is a modern PHP implementation based on the dutch-tax-income-calculator-npm package.

Features

  • Payroll Tax (Loonbelasting) calculation
  • Social Security Contributions (Volksverzekeringen - AOW, Anw, Wlz)
  • General Tax Credit (Algemene Heffingskorting)
  • Labour Tax Credit (Arbeidskorting)
  • Elder Credit (for retirement age workers)
  • 30% Ruling (30%-regeling) for expats
  • Holiday Allowance (Vakantiegeld - 8%)
  • Support for tax years 2015-2026
  • Framework-agnostic - works with Laravel, Symfony or any PHP project

Requirements

  • PHP 8.4 or higher

Installation

composer require fiscfree/dutch-tax-income-calculator

Quick Start

<?php

use DutchTaxCalculator\DutchTaxCalculator;
use DutchTaxCalculator\DTO\SalaryInput;
use DutchTaxCalculator\Enum\Period;

$calculator = new DutchTaxCalculator();

$result = $calculator->calculate(
    input: new SalaryInput(
        income: 60000.00,
        includeHolidayAllowance: true,
        socialSecurity: true,
        reachedRetirementAge: false,
        hoursPerWeek: 40.0
    ),
    period: Period::Year,
    year: 2026
);

echo "Gross yearly: " . $result->grossYear . "\n";
echo "Net yearly: " . $result->netYear . "\n";
echo "Net monthly: " . $result->netMonth . "\n";
echo "Income tax: " . $result->incomeTax . "\n";
echo "Effective tax rate: " . $result->effectiveTaxRate . "%\n";

Usage Examples

Basic Calculation

use DutchTaxCalculator\DutchTaxCalculator;
use DutchTaxCalculator\DTO\SalaryInput;
use DutchTaxCalculator\Enum\Period;

$calculator = new DutchTaxCalculator();

// Calculate from monthly salary
$result = $calculator->calculate(
    input: new SalaryInput(income: 5000.00),
    period: Period::Month,
    year: 2026
);

// Access results
$result->grossYear;      // Annual gross income
$result->grossMonth;     // Monthly gross income
$result->netYear;        // Annual net income
$result->netMonth;       // Monthly net income
$result->incomeTax;      // Total income tax (negative)
$result->payrollTax;     // Payroll tax (negative)
$result->socialTax;      // Social security (negative)
$result->labourCredit;   // Labour credit (positive)
$result->generalCredit;  // General credit (positive)

With 30% Ruling

use DutchTaxCalculator\DutchTaxCalculator;
use DutchTaxCalculator\DTO\SalaryInput;
use DutchTaxCalculator\DTO\RulingOptions;
use DutchTaxCalculator\Enum\Period;
use DutchTaxCalculator\Enum\RulingType;

$calculator = new DutchTaxCalculator();

// Using factory method (recommended)
$result = $calculator->calculate(
    input: new SalaryInput(income: 80000.00),
    period: Period::Year,
    year: 2026,
    ruling: RulingOptions::enabled()  // or enabled(RulingType::YoungMaster)
);

// Or using constructor
$result = $calculator->calculate(
    input: new SalaryInput(income: 80000.00),
    period: Period::Year,
    year: 2026,
    ruling: new RulingOptions(
        enabled: true,
        type: RulingType::Normal  // Normal, YoungMaster or Research
    )
);

echo "Tax-free amount: " . $result->taxFreeYear . "\n";
echo "Tax-free percentage: " . $result->taxFreePercent . "%\n";

Different Input Periods

// From yearly salary
$calculator->calculate(
    input: new SalaryInput(income: 60000.00),
    period: Period::Year,
    year: 2026
);

// From monthly salary
$calculator->calculate(
    input: new SalaryInput(income: 5000.00),
    period: Period::Month,
    year: 2026
);

// From weekly salary
$calculator->calculate(
    input: new SalaryInput(income: 1154.00),
    period: Period::Week,
    year: 2026
);

// From hourly rate
$calculator->calculate(
    input: new SalaryInput(income: 28.85, hoursPerWeek: 40.0),
    period: Period::Hour,
    year: 2026
);

Retirement Age Workers

$result = $calculator->calculate(
    input: new SalaryInput(
        income: 50000.00,
        reachedRetirementAge: true  // No AOW contribution
    ),
    period: Period::Year,
    year: 2026
);

Without Social Security

$result = $calculator->calculate(
    input: new SalaryInput(
        income: 50000.00,
        socialSecurity: false  // No volksverzekeringen
    ),
    period: Period::Year,
    year: 2026
);

Result Object

The PaycheckResult object provides comprehensive access to all calculated values:

Property Description
grossYear Annual gross income
grossMonth Monthly gross income
grossWeek Weekly gross income
grossDay Daily gross income
grossHour Hourly gross income
grossAllowance Holiday allowance (vakantiegeld)
taxFreeYear Tax-free amount (30% ruling)
taxFreePercent Tax-free percentage
taxableYear Annual taxable income
payrollTax Payroll tax (negative)
socialTax Social security (negative)
taxWithoutCredit Total tax before credits
labourCredit Labour credit (positive)
generalCredit General credit (positive)
taxCredit Total tax credits
incomeTax Final income tax
netYear Annual net income
netMonth Monthly net income
netWeek Weekly net income
netDay Daily net income
netHour Hourly net income
netAllowance Net holiday allowance
effectiveTaxRate Effective tax rate (%)

Framework Integration

Laravel

Register as a singleton in a service provider:

// AppServiceProvider.php
public function register(): void
{
    $this->app->singleton(
        \DutchTaxCalculator\DutchTaxCalculator::class,
        fn() => new \DutchTaxCalculator\DutchTaxCalculator()
    );
}

Symfony

Define as a service:

# services.yaml
services:
    DutchTaxCalculator\DutchTaxCalculator: ~

Supported Tax Years

The calculator supports tax years 2015-2026. Tax data is sourced from official Belastingdienst publications.

$calculator->getSupportedYears();  // [2015, 2016, ..., 2026]
$calculator->getCurrentYear();     // 2026
$calculator->isYearSupported(2025); // true

Development

# Install dependencies
composer install

# Run tests
composer test

# Run static analysis
composer phpstan

# Fix code style
composer cs-fix

Testing

The calculator is tested against official Belastingdienst tax tables for all supported years:

vendor/bin/phpunit

References

Credits

License

MIT License - see LICENSE file for details.

统计信息

  • 总下载量: 776
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固