rubyforgood / human-essentials

Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.
https://humanessentials.app
MIT License
454 stars 486 forks source link

[PACKS] #13 Calcuate Product Totals #4408

Open cielf opened 4 months ago

cielf commented 4 months ago

Summary

Update Calculate Product Totals to include packs

Why

This is step #13 of adding the ability to specify "packs" versus "individual" for requests

Details

"Calculate Product Totals" on the Bank's request index (left hand menu Requests) currently products a list of the items that are in the outstanding requests, with a total of the number of each item needed.

(/requests#calcluateTotals)

Instead of having one line per item, we will need to provide one line per item/unit combintation.

So, if we have both requests for units and for custom units, there will be multiple lines for the item. The custom request unit will be included in the Quantity Column.

Let's also make the list alpabetical by item name, with # of items for the "normal" units first, and then any with the packs.

Visual Aid

Image

N.B.

All of the changes for PACKS must be implemented behind a flipper flag "enable_packs"

1/ Flipper works by enabling or disabling a tag (for the PACKS issues, that is enable_packs) 2/ Here is a code snippet illustrating how to use it in your code, with enable_packs as the example tag: if Flipper.enabled?(:enable_packs) // do the thing we are guarding with the tag end 3/ How to check out if it works manually (with the example tag: enable_packs ): You have to enable the flipper tag on your localhost (note - the tag is stored in your db, so if you reset your db you have to do it again)

localhost:3000/flipper

userid: admin password: password Sign In

Click: Add feature enable_packs Click: Add feature

Click: Fully enable

To set it back (to check that your nifty changes haven’t broken anything when the flag is off) Sign in as above: click on “enable_packs” click “Delete” type enable_packs in the “Are you sure” dialog and click ok

Criteria for completion

Background

The following sections have been identified as required for the PACKS implementation. These should be implemented in numerical order. This particular one was a late-found change, and so isn't in the diagram below.

Image

github-actions[bot] commented 1 month ago

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.