-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation for the tax calculation.
- Loading branch information
0 parents
commit e4dcff0
Showing
15 changed files
with
1,228 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/). |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.