Git Product home page Git Product logo

money-utils's Introduction

Money-Utils

Automatic reporting system for small clubs analyzing member fees and drink sales.

Monitors money transfers to an account and filters them according to various patterns to report information.

Features

  • Track member fee payments and automatic membership status
  • Allows drink account fillup via SEPA bank transfers
  • Track expenses and income for drink sales
  • Manage member information

Developer Setup

Note:
If all you want is run the service, please head down to the Deployment section.

  • If you're on Debian, you will need some more packages:

    apt install python3-dev build-essential
  • Enable lingering services for your user:

    sudo loginctl enable-linger $USER
  • Copy config.example.py to config.py and customize contents according to your likings.

The following script will:

  • Make a virtualenv and install dependencies from pyproject.toml

  • Setup a systemd-user-service money.service

    ./setup.sh
  • Make a database:

    mkdir -p data
    ./manage.py migrate
    ./manage.py createsuperuser
  • Run Cron jobs to import TXs

    • this will:
      • import transactions from your bank
      • analyze member fees
    ./manage.py runcrons
  • Start server:

    ./manage.py runserver
    
    # or, enable and start the systemd service:
    systemctl --user enable --now money
  • go to http://localhost:5002/ and enjoy the stats!

Deployment in dev setup:

  • Edit uwsgi.ini

  • Run:

    ./manage.py collectstatic
    ./webserver

Deployment

Do these steps:

export SOURCE_COMMIT=$(git describe --always --no-abbrev)
docker-compose build

docker-compose up

## in another window:
docker-compose exec money ./manage.py migrate
docker-compose exec money ./manage.py cratesuperuser

Member Management

Once the server is running, go to http://localhost:8000/admin. Log in, and click on "Members". Add some members. The only fields you will have to fill out:

  • First Name
  • Last Name (if you know it)
  • Nickname (if you know it)
  • Email (if you know it)
  • Fee (if it isn't one of the standard fees from fee_util.py)

These properties will be used to find the member fee transactions. All the other fields will be filled by the analysis.

After adding some members, do ./manage.py runcrons again to analyze their fees.

License

GPLv3. Other licenses available upon request.



BELOW LEGACY

/recharges.json

Lists drinks-recharge events according to the pattern drinks <uid> <info>, where

  • uid is the LDAP user ID
  • info is some additional text, commonly "username random-string"

The random string at the end is used to differentiate recharges happening on the same day, since SEPA does not generate unique transaction IDs. Instead, it considers the 5-tuple (date, IBAN from, IBAN to, amount, transaction text) as unique key.

loads new transactions from the bank.

performs member fee analysis.

displays an oldschool ASCII report of paid member fees in the last 12 months.

clears all analyzed data from database (except for Fee_Entries). Can be used to rescue the database from botched data if you're messing with the members.py script.

Wrapper for the python-fints library.


Old stuff:

old report: loads transactions and drinks-recharges using an ad-hoc pickle cache defined in cache.py.

Legacy; has been integrated into django app on /recharges.py

webserver: small flask webserver to do nothing but serve the output of drinks.py as JSON.

Can be started as systemd service, using money.service.


money-utils's People

Contributors

cfstras avatar dargmuesli avatar dependabot[bot] avatar malled2002 avatar soerface avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

money-utils's Issues

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.