Code Monkey home page Code Monkey logo

intakt's Introduction

intakt: D-guild's tool for creating intäktsräknignar

intakt is a tool to generate intäktsräkningar from the sales of Zettle and Swish.

This project were started in 2021 by the treasurer of the time, Joel Bäcker, and has been updated during 2022 by the same person. For the time beeing it is only available in terminal form, and some credentials are needed to create intäktsräkningar.

The work is currently focused on connecting the front end to the backend as well as reformating the code. If you want to contribute, get in contact with Joel Bäcker.

How to use

There is two ways the program can be ran.

Terminal

The terminal bassed approach works a bit diffrently whether you want a Zettle or a Swish report.

You need to choose which source to retrieve the data from using -s or --source. Available options are zettle, swish and fees.

Zettle

Set up credentials

To use the Zettle API you need an API key

Click this link to create a key

The client id and key should be put in the file main/credentials/access.json (create the credentials folder if it doesn't exist) and should look like this:

{
    "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
    "client_id": "<CLIENT_ID>",
    "assertion": "<API KEY>"
}

Use the program

The available option for the Zettle parser is:

  • -sd / --start-date
  • -ed / --end-date

If end date is left empty then is will produce a report until the current day, start day is not optional.

To use the parser:

Ex. 1:

./main/main.py -s "zettle" -sd 2022-06-01 -ed 2022-08-30

Ex. 2:

./main/main.py --start-date 2022-04-04 --end-date 2022-05-04

Fees

Use source fees together with start and end dates to get the fees from Zettle.

Swish

Swish is used in a similar manor. The available arguments are:

  • -inp / --input-fp

To use the swish parser:

Ex. 1

./main/main.py --source "swish" -inp swish/jan_aug.csv

Front end

To start the web page you need to run

make webpage

or

python3 webpage/index.py

in the top folder of this project. This page is then ran on localhost:1999.

This page is currently not connected to the backend, but you can look at it and admire a beautiful web page #komochkodamedDWWW.

intakt's People

Contributors

erik-stein avatar fnurkla avatar gitthisjoel avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

intakt's Issues

Improve/investigate ways of reading content from files

@erik-stein Suggested in a PR that we could/should change the way we read contents from files. Since our path are represented using the class Path we can use function from that package to read files.

e.g. in main/tex_compiler/tex_compiler.py:

self.intakt_skeleton: Path = ... 
with open(self.intakt_skeleton, "r") as skel_f:
    tex_skeleton = skel_f.read()

could be written as

self.intakt_skeleton: Path = ... 
tex_skeleton = self.intakt_skeleton.read_text()

If someone could do this/look in this, that would be great.

Utöka README:n

Bara så man (jag) vet vad skriptet/-arna ska göra och hur användningen ska gå till.

Automatic combine pdf

Some part of the program should handle combining pdfs, i recommend doing this with pdfjam, eg. pdfjam swish/*.pdf -o swish_aug_jan.pdf

Choose which utskott to generate intakt for

As the title says it would be nice if one could filter the utskott to fetch sales-data from.

Might be easiest if we add an argument in main.py that handles this and link it some how with zettle_parser.py.

Get master's data from dsek.se?

We probably do not need to keep out own record on who is the master of a certain committee. Is there a possibility that dsek.se could implement some sort of API or something similar that could omit the use of masters.json?

Improve error handling for wrong formatted products

Sadly, people do not understand the importance and beauty of book keeping and thus bad formatted products are present in our organization. For the time being a fairly basic error handling are present in the Zettle parser, this could use some touch ups and improvements.

Improve retrieval of Swish data

At the moment the only way of getting Swish sales is by some sketchy ways in the bank. There is a API for Swish, we should really try to get our hands on it.

Utöka accounts.json till full sanningskälla

Genom att lägga till utskottsnamnet som element i accounts.json skulle man kunna använda den som ensam sanningskälla (source of truth) för vad förkortningarna betyder. Då kan man ändra på ett ställe om man vill lägga till fler utskott, förkortningar eller annat.

Kanske värt att byta namnet på filen isf.

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.