jonczek/tax-de

Tax library for german tax calculation.

1.0.0 2020-02-28 12:35 UTC

This package is auto-updated.

Last update: 2024-04-28 22:30:53 UTC


README

Tax library for german tax calculation written in PHP.

Overview

  • Income Tax (Einkommensteuer)
  • Trade Tax / Business Tax (Gewerbesteuer)
  • Value Added Tax (Umsatzsteuer)
  • Solidarity Tax (Solidaritätszuschlag)
  • Rate Of Assessment / Trade Tax Factor (Hebesatz)
  • Corporation Tax (Körperschaftsteuer)
  • Cash Accounting (Einahmen-Überschuss-Rechnung)

Installation

composer install jonczek/tax-de

Usage

Value added tax calculation example

Add tax entries to a repository:

$repository = new GenericRepository();
$repository->add(new ValueAddedTaxEntry(119));
$repository->add(new ValueAddedTaxEntry(238));
$repository->add(new ValueAddedTaxEntry(107, ValueAddedTaxRate::REDUCED_RATE));
$repository->add(new ValueAddedTaxEntry(214, ValueAddedTaxRate::REDUCED_RATE));
$repository->add(new ValueAddedTaxEntry(100, ValueAddedTaxRate::REDUCED_RATE, true));
$repository->add(new ValueAddedTaxEntry(200, ValueAddedTaxRate::FULL_RATE, true));

Calculate value added tax using the repository:

$calculator = new ValueAddedTaxCalculator();
$result = $calculator->calculate($repository);

Result:

Jonczek\Tax\Model\ValueAddedTaxCalculationResult Object
(
    [net:protected] => 900
    [gross:protected] => 1023
    [tax:protected] => 123
)