git-girl / bmf-taxcalculator-csv

german income tax calculator supporting entering of datasets - fork of https://mgoltzsche.github.io/fa-pap-xml-interpreter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An easily changable Tax Calculator for the german tax code

The App by @mgoltzsche interprets the XML Pseudo Codes by BMF and generates a calculation in Javascript. I simply wrote something to input a CSV and get the values out into a Textarea. This can be used f.e. in the social sciences to create counterfactual models, especially beacuse this app can be run locally and doesn't require any remote connections.

@mgoltzshces project is published with an Apache 2.0 Lincense so the license must be maintained.

This Version isn't served anywhere I'm aware of. You will need to clone the repository and open the src/index.html file.

Big thanks to @JonnyTischbein for helping out big time on the CSV read hook :) !

Using the App

The order you input these files matters

  1. Clone this repository from your terminal by running git clone https://github.com/git-girl/bmf-taxcalculator-csv.git. Optionally you can just download it as a zip file. For properly building the app see further below.

  2. Download and modify the pseudo-codes in XML from (BMF).

  3. Create the Dataset in your statistics software of choice and export it to CSV.

  4. Open your local repository and open the dist/index.htmlin your browser ( making sure to enable javascript ).

  5. Select your XML file

  6. Select your CSV file

  7. Wait a bit depending on the processing power of your machine.

  8. Copy and paste the text from the Output field into a csv file.

    • for example: in your terminal run

      cd ~/some/directory/path
      touch output.csv 
      vim output.csv 
      
    • then paste in the results (saving and exiting vim by :wq)

  9. Your output CSV is ready to be imported into your statistics software

Tips for modiying the XML

  • The flowcharts by BMF are quite helpful in identifying the area that needs to be changed

  • Another option is to search through the XML by some specific numeric value, f.e. of a tax rate

  • The XML while human readable, is a bit overwhelming at times, just try focussing on the general structure, rather than trying to understand all the commands

Debugging

  • When Inputting a different PAP-XML file, or modifying it it is not unlikely that it will throw some errors.
  • Look in the XML file first, the Javascript written by @mgoltzsche is really nice.
  • The Errors shown in the Red bordered window should help
  • If not than you can make changes to the javascript by @mgoltzsche by making changes in the ./src folder then running, make publish.
    • For example you can add a console.log(some_variable) to some line, run make publish, and check that the generated index_bundle.js is specified in the index.html you are opening in the script tag
    • As some console logging can slow the app down you might need to comment out the testing from the package.json file as this will throw errors if some part takes more than 2 seconds

Build

- make requires podman or docker but worked best with podman for me 
  - add a new podman machine 
  - run it 
  - in directory of cloned repo add the podman ssh key to your ssh agent 
    (ssh-add ~/.ssh_ORYOURSSHFILEPATH/.podman-machine-default
  - NOW run make 

About

german income tax calculator supporting entering of datasets - fork of https://mgoltzsche.github.io/fa-pap-xml-interpreter/

License:Apache License 2.0


Languages

Language:HTML 74.1%Language:JavaScript 24.6%Language:SCSS 0.9%Language:Dockerfile 0.2%Language:Makefile 0.2%