Skip to content

Commit

Permalink
Initial implementation for the tax calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
awinterstein committed Jan 13, 2025
0 parents commit e4dcff0
Show file tree
Hide file tree
Showing 15 changed files with 1,228 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build-and-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build & Test
run-name: ""
on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
Build-and-Test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Build the workspace
run: cargo build --verbose
- name: Test the workspace
run: cargo test --verbose
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
242 changes: 242 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[workspace]
resolver = "2"
members = [
"net_income_germany",
"net_income_germany_cmd",
]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Net Income (Germany)
[![Build & Test](https://github.com/awinterstein/net-income-germany/actions/workflows/build-and-tests.yaml/badge.svg)](https://github.com/awinterstein/net-income-germany/actions/workflows/build-and-tests.yaml)

See documentation for the net income module in the sudirectory [net_income_germany](net_income_germany/).
7 changes: 7 additions & 0 deletions net_income_germany/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions net_income_germany/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "net-income-germany"
description = "Net income calculation for a given gross income based on the German social security and income tax rules."
publish = ["cerritus"]
license = "MPL-2.0"
version = "0.1.0"
edition = "2021"
authors = ["Adrian Winterstein <adrian@winterstein.biz>"]
repository = "https://deposito.cerritus.eu/freelancing/net-income-germany"
27 changes: 27 additions & 0 deletions net_income_germany/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# net-income-germany

Calculates the net income from a given yearly gross income.

## Example
```rust
// set the necessary input data values
let tax_data = net_income_germany::TaxData {
gross_income: 80000, // the gross income of one year
expenses: 5300, // the tax-deductible expenses of one year
fixed_retirement: Some(800), // an optional fixed monthly retirement rate (otherwise percentage applies)
self_employed: false, // whether social security taxes should be calculated for a self-employed person
married: false, // whether tax splitting due to marriage should apply
};

// create the default configuration for a specific year
let config = net_income_germany::config::create(2025)?;

// do the tax calculation based on the input data values
let tax_result = net_income_germany::calculate(&config, &tax_data)?;

// access the results (in this example just the resulting net income)
println!("Net income: {}", tax_result.net_income);

```

License: MPL-2.0
Loading

0 comments on commit e4dcff0

Please sign in to comment.