Code Monkey home page Code Monkey logo

beer-excise-tax-calculator's Introduction

Beer excise tax calculator

Excise Tax Calculator

Introduction

You have to make your life easier, right?

For this occasion, I have created an application to calculate excise taxes for beer. The application, with the help of React-paparse, takes a generated .CSV file and parses it into a JSON file. Based on the generated JSON file, the table with a list of all the beers is created. Due to the fact that the files generated in my work are not perfect I had to use Regexp. With its help, the name of the beer with data such as extract, volume, and type of package are separated into separate columns. In this way we get a table that is readable and ready for eventual editing. The table is used primarily for a clear check of the accuracy of the data obtained from the .CSV file and, if necessary, the opportunity to correct it.

In the next part of the application, the data downloaded from the JSON file is filtered to get rid of non-alcoholic beers (we don't count excise for them in Polish law). The next step, depending on the volume that appears next to the item, the amount of beer is converted according to a simple formula into hectoliters, and then the tax to be paid expressed in Polish zlotys. In addition, with the results you have the opportunity to check whether the brewery is entitled to a 50% discount on the tax.

All actions from parsing to tax calculation are saved in localstorage just in case ๐Ÿ˜†.

Cheers!

Ps: This application was created to work on files generated in my work. You can assume with 99% certainty that it will not work on files from another brewery.

Description

Excise duty calculator for beer according to Polish tax law

Instructions

  1. Download test.csv file from Public folder, and save it.
  2. Browse test.csv file.
  3. Let the magic begin!

Technologies

  • React.js
  • Vite
  • TypeScript
  • Zustand
  • Tanstack Table
  • React papaparse
  • TailwindCSS

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

  • Configure the top-level parserOptions property like this:
   parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module',
    project: ['./tsconfig.json', './tsconfig.node.json'],
    tsconfigRootDir: __dirname,
   },
  • Replace plugin:@typescript-eslint/recommended to plugin:@typescript-eslint/recommended-type-checked or plugin:@typescript-eslint/strict-type-checked
  • Optionally add plugin:@typescript-eslint/stylistic-type-checked
  • Install eslint-plugin-react and add plugin:react/recommended & plugin:react/jsx-runtime to the extends list

beer-excise-tax-calculator's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.