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

Implement weight / pc upstream #187

Open
wvengen opened this issue Jan 29, 2021 · 3 comments
Open

Implement weight / pc upstream #187

wvengen opened this issue Jan 29, 2021 · 3 comments

Comments

@wvengen
Copy link
Member

wvengen commented Jan 29, 2021

For foodcoops handling fresh produce, there is a need to enter amounts not in how many units, but in grams (or volume of liquid).
This has been implemented in this fork with a unit - pieces switch, but needs to go upstream.

@wvengen
Copy link
Member Author

wvengen commented Jan 29, 2021

Related issues:

@wvengen
Copy link
Member Author

wvengen commented Jan 29, 2021

To understand, the foodcoop-adam fork has the current functionality.

The receive and distribute screens are part of the current_orders plugin, which is present in upstream Foodsoft already, but upstream it does not have the pc / weight switch shown here. Note that this is only implemented in the plugin, not in the order screen where you can edit group_order_article amounts.

Receive

Not implemented.

Distribute

'pc' is regular behaviour, you enter the amount in a number of times the unit.
image

You can select 'g' here, which is parsed from a unit-parsing gem from the article unit. Since the unit is '90gr', it shows 'g'.
image

So if you'd like to enter 180g, with regular behaviour ('pc' button) you'd need to enter 180g / 90g = 2. In unit-mode ('g'), you'd just enter 180g. This can save a lot of head-calculation and errors.

How this works internally is that a form sends a multiplier for each group_order_article, and the switch indicates if the multiplier is used or not.

Member orders

image

image

@wvengen
Copy link
Member Author

wvengen commented Jan 30, 2021

In practice there are several kinds of articles with their own distribution flow.

Packaged by piece

Items that come packaged, where each item that is distributed to members has its own package, are well supported by the current Foodsoft approach: members can order by item, and items can be ordered from the supplier by unit quantity.

Packaged in bulk

Items that are packaged in large quantities like rice, flour, macaroni and raisins can be ordered from the supplier by package and distributed to members in smaller amounts. These smaller amounts are fixed amounts, so when bulk is per 10kg and members order per 100g, a member cannot order per 50g. But since the foodcoop can adjust this amount, it is no problem in practice.

Also, when distributing and the member gets 123g instead of 100g, this can still be entered in the system, even though it may require some head mental arithmetic.

Packaged by varying pieces

Some fresh produce like cabbage and pumpkin can be ordered from the supplier by weight (boxes) and distributed to members by piece having an average weight. If the pieces are about the same size, they can be handled as 'packaged by piece', but if they have very different sizes, it may be more fair to everyone to distribute by weight. This decision can only be made at receive or distribute time.

The current issue is mainly about 'packaged by varying pieces'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant