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

Unify article sorting across views #1068

Open twothreenine opened 2 months ago

twothreenine commented 2 months ago

I find it quite inconvenient at times that articles are sorted differently in different menus/views.

For example, some of our suppliers print out the order PDF and use it as a basis for a delivery note / invoice (they add the actual prices or cross out articles which they can't deliver), or they write their own invoice in the same order. When comparing such an invoice to the article PDF and/or the accounting menu, you have extra work to find each article in each list. If they were sorted in the same way, lists would be much easier to compare.

By looking at the views (in the frontend, not in the code) I determined there are 3 general sortings used:

  1. article name
  2. category, article name
  3. order number (else: article name)

Here's an incomplete list of the sortings used by each view:

view(s) primary sorting secondary sorting options
order placement (group order form, show) category article name searchable
order management (overview, edit order) category article name searchable
order management: sorted in groups/articles category (invisible) article name searchable
group PDF, article PDF, matrix PDF (for multiple orders too) article name
fax PDF order number else: article name
fax CSV, fax text category (invisible) article name
receive order number else: article name sortable by order number, name, unit
accounting: overview (edit) article name searchable
accounting: sorted in groups/articles category (invisible) article name
supplier articles management category article name searchable; sortable by name, category, unit, note
supplier articles: edit all, CSV download category article name

Since (category, article name) is the most commonly used sorting, and there's good reason to sort articles by category at least in order placement views, I'd propose to apply it to all views, resulting in the following changes:

view to apply (category, article name) sorting additional changes
group PDF, matrix PDF (for multiple orders too)
article PDF (for multiple orders too) show categories & order numbers?
fax PDF show categories?
receive show categories?
accounting: overview (edit) show categories?

Or do you think there's any good reason to prefer sorting by order number in fax PDF / receive, and apply this to accounting, fax CSV, group/article/matrix PDF etc. instead?

wvengen commented 2 months ago

Lists from the supplier are often sorted by article number. There are places where you'd put this together with Foodsoft, e.g. during receive and maybe during ordering (fax PDF), where it could be useful to order by article number.

Apart from that, I think harmonising this is great for everyone.

twothreenine commented 2 months ago

Good point.

Perhaps the best option for that case would be to introduce two select fields which can be set for each supplier:

If you only want a different sorting for receive, you could still use the sorting feature there each time.

Another option could be to make each list sortable, But for PDFs/CSVs, we would have to add more options ...

wvengen commented 2 months ago

I like your two kinds of lists. Good to hear that receive can already sort in place. I think that could actually be good enough. There's also something with keeping the settings clean and not too overwhelming, where good defaults help. Maybe I'd provide a good default, with the option to sort with a click by article number where useful (or would break existing use) -and document!. Maybe add the preference based on user request (so it addresses a real existing need). Just some thoughts, not fully clear yet :)