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

`get_client_prices` #842

Open kousu opened 5 years ago

kousu commented 5 years ago

While reviewing #839 I noticed get_client_prices(). It is a little shim to handle differently-billed clients but whereas it's called in auto_create_orders() and create_batch_orders(), in add_item(), which I believe is function called when entering orders manually, MAIN_PRICE_DEFAULT is used directly

https://github.com/savoirfairelinux/sous-chef/blob/396f86d696fd1dc541b6556dacea8a621e2b7420/src/order/models.py#L402

so I theorize it won't properly bill low-income clients if they call in an order.

https://github.com/savoirfairelinux/sous-chef/blob/396f86d696fd1dc541b6556dacea8a621e2b7420/src/order/models.py#L136-L146

Related issues:

JeanFrancoisFournier commented 5 years ago

Not sure but create_batch_orders() could be related to the ability within the UI to select multiple dates when creating an order manually. This would allow the user to speed up the order taking by applying the same items and prices to multiples individual orders. Also it might speed up the computing instead of running the price check for every individual order when doing this in batch? Not sure...

Related issues: Solidary rate was not a typo, it's the way they used to call that higher braket in the 2015 sliding scale introduction. It's not used at this point but could allow us to add a 3rd level to our existing sliding scale when we get there.

Does this help?