Skip to content

taxcalcs/taxjs

Repository files navigation

TaxJs Node.js CI CodeQL NPM

TaxJs is a typescript and javascript library to calculate german tax.

The code is generated from pseudo code from https://www.bmf-steuerrechner.de/

Test page: https://taxcalcs.github.io/taxjs-test/

Usage

let tax = new Lohnsteuer2021Big();
tax.initInputs();

tax.setLZZ(2); // Lohnzahlungszeitraum
tax.setKVZ(1.3); // Einkommensbezogener Zusatzbeitragssatz
tax.setSTKL(1); // Steuerklasse
tax.setPVZ(1); // Zuschlag soziale Pflegeversicherung
tax.setRE4(new Big(1234500)); // Steuerpflichtiger Arbeitslohn in Cent

tax.calculate();

tax.getLSTLZZ().toNumber(); // Lohnsteuer in Cent

You can find all fields on the test page.

Dependencies

As replacement for the Java BigDecimal class the library big.js and the typescript definition @types/big.js are used.

Development

For convert xslt file into xslt sef file you have to install xslt3.

npm install -g  xslt3

and

npm run compile-xsl

For compile typscript into javascript you have to install typescript.

npm install -g  typescript