foodcoops / foodsoft

Web-based software to manage a non-profit food coop (product catalog, ordering, accounting, job scheduling).
https://foodcoops.net/
Other
318 stars 146 forks source link

Finance ordergroup balance sums are misleading + performance issue #1044

Closed twothreenine closed 4 months ago

twothreenine commented 5 months ago

The feature introduced in #1017 as requested in #382 takes the sum of all transactions of a certain transaction class. However, these include foodcoop transactions as well as transactions from deleted ordergroups, with both aren't listed in the table.

I've reproduced this in the international demo by

  1. creating a foodcoop transaction of 20 € (transaction class Standard)
  2. creating an ordergroup deletion test, granting 100 € (transaction class Standard), then deleting the ordergroup

Now, the sum of Standard doesn't match the values above it (should be 110 €, but is 230 €). grafik

The "total" value suggests to be the sum of the values above, so I think both foodcoop transactions and transactions from deleted ordergroups should be excluded from this calculation. For my understanding of foodcoop transactions, it wouldn't make sense to include a Foodcoop ordergroup in this table.

Performance: I also noticed that, in Foodsofts with a lot of transactions over many years, this menu loads significantly slower now (takes more than 20 s in ours.) Also each time when I switch between page sizes (20/50/100/500) or between pages.

yksflip commented 4 months ago

wow, thank you. No idea why I didn't think about that. Also I completely ignored the filtering/pagination ... I think I found a good solution in #1051 for that. It should also improve the performance. Would you like to give that a test before I merge it? :)

twothreenine commented 4 months ago

Awesome! I didn't test for pagination and performance, but it works now for foodcoop transactions and deleted ordergroups.