savoirfairelinux / sous-chef

Sous-Chef is a web application to help organizations to plan and deliver meals, and to manage clients files.
GNU Affero General Public License v3.0
67 stars 45 forks source link

Route size monitoring - Dashboard ajustment #821

Open JeanFrancoisFournier opened 6 years ago

JeanFrancoisFournier commented 6 years ago

Expected Behaviour

Following up on issues #713 and #735 here is a new issue that should fix for good the expected behaviour.

Provided that: The user will maintain a MEAL DEFAULTS (number/size of main dishes and number/type of side dishes) for every client and for every delivery days regardless of whether or not that day is included in the client's MEAL SCHEDULE.

Provided that: The number shown in bold at the cross section of a ROUTE and DELIVERY DAY already adds up the number of meals (regardless of SIZES) needed for all ACTIVE, PAUSED and PENDING clients according to their MEAL DEFAULTS and does not need any fixing.

And: In order to monitor the hypothetic number of meals (regardless of SIZES) that could be ordered on a hypothetical "perfect storm" delivery day...

We wish that the Route size monitoring dashboard table reflect this logic:

The number shown in parenthesis should ONLY reflect the hypothetical number of meals (according to their MEAL DEFAULTS and regardless of SIZES) that could be ordered by EPISODIC clients (ACTIVE, PAUSED and PENDING) if they all ordered on that given delivery day.

Actual Behaviour

It seems that the number in parenthesis on that table's logic is including the MEAL DEFAULTS of all ONGOING clients who don't have that specific day in their MEAL SCHEDULE, but have a MEAL DEFAULT for that day.

JeanFrancoisFournier commented 5 years ago

this is not me thinking that deep but...

In short: defaults[day] is being malcomputed by this section:

https://github.com/savoirfairelinux/sous-chef/blob/b2be5bd3e6df0440d49509caa2b2c4736d0eb0c7/src/page/views.py#L74-L80

guillaumep commented 4 years ago

I'll take this one.

guillaumep commented 4 years ago

Also, JF would like a "total" line in the dashboard.