Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reports #277

Merged
merged 13 commits into from
Jan 13, 2024
Merged

Reports #277

merged 13 commits into from
Jan 13, 2024

Conversation

mhvis
Copy link
Member

@mhvis mhvis commented Dec 29, 2023

Finance reports:

  • Balance report: shows the start and end balance for associations and kitchen cost.
  • Cash flow matrix: shows the flow of money between accounts.
  • Site transactions: lists all transactions on the site, except for user transactions (deposits/withdrawals/kitchen payments).
  • Stale accounts report: determines the age of an account by their last transaction date, and aggregates them in groups depending on their age.

Dining reports:

  • Diners: cooked for/kitchen usage/...
  • Membership counts
  • Leaderboard

Screenshots:

image

image

@mhvis mhvis added the enhancement New feature or request label Dec 29, 2023
@mhvis mhvis changed the title Balance report Reports Dec 30, 2023
@mhvis mhvis requested a review from DutcherNL January 6, 2024 18:27
)


# SQL for diners count
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of Django is that you don't have to focus on SQL queries. Is the reason you placed the commented SQL queries purely as a replacement for test-cases? If so, honestly, I think it's not neccessary honestly as long as the function is well documented in what it intends to do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the generated SQL queries to come up with the correct QuerySet code and check that it's correct. It's much easier to see what is happening in the SQL and whether I would need to use DISTINCT somewhere. I left the queries there just for documentation.

The idea for Django's ORM is not to not use SQL, but as an abstraction so that you can use multiple databases with their own SQL dialects, and as a mapper between rows and Python objects ('Object Relational Mapping'). There is nothing wrong with SQL, in fact I would prefer it if the object mapping wasn't such a great feature of Django.

@mhvis mhvis merged commit 1a021a6 into master Jan 13, 2024
1 check passed
@mhvis mhvis deleted the mhvis/202312/balance branch January 13, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants