Skip to content

taxcalcs/taxcalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

taxcalculator Build Status Codacy Badge Known Vulnerabilities version

- The 2018 version will be changed to Java 8. 

Generated code for german tax from https://www.bmf-steuerrechner.de/

Project: https://taxcalcs.github.io/taxcalculator/
Javadoc: https://taxcalcs.github.io/taxcalculator/apidocs/

JDK 9 module name: info.kuechler.bmf.taxcalculator

For an API to use the test interfaces at the BMF see taxapi.

Usage

You can download it from maven central repository:

<dependency>
    <groupId>info.kuechler.bmf.taxcalculator</groupId>
    <artifactId>taxcalculator</artifactId>
    <version>2023.1.0</version>
</dependency>

Versions are backwards compatible. You can use the latest version and can use the calculations since 2006.

Example

With Reader / Writer

Writer writer = TaxCalculatorFactory.createWithWriter(0, 2019);
// 1. monthly payment
// 2. tax class
// 3. income in cent
writer.set("LZZ", 2).set("STKL", 1).set("RE4", new BigDecimal("223456"));
// 4. a half child :)
// 5. additional med insurance [percent]
// 6. pensions fund: east germany
final Map<String, Object> parameter = new HashMap<>();
parameter.put("ZKF", 0.5);
parameter.put("KVZ", 1.10);
parameter.put("KRV", 1);
writer.setAll(parameter); // with setAll the correct type is detected

// calculate result and return a Reader to read values
Reader reader = writer.calculate();

BigDecimal lst = reader.get("LSTLZZ");
BigDecimal soli = reader.get("SOLZLZZ");

Assert.assertEquals(23350, lst.longValue());
Assert.assertEquals(825, soli.longValue());

System.out.println("Lohnsteuer: " + lst.divide(new BigDecimal("100")) + " EUR");
System.out.println("Soli: " + soli.divide(new BigDecimal("100")) + " EUR");

With Accessor / Direct with generated classes

Both variants can found in this Test

License

MIT License