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.
Disable the deletion of donations and purchases if they include an inactive item
Why?
We're going to error out on this anyway, better to be up front about it.
Also, on purchases, it's currently throwing an inventory error (which will be a 500 in production)
Details
This is in the view for the donations and purchase.
We already disable the "make a correction" button if there are inactive items
Do the same for the delete button
Change the informational message regarding why the buttons are disabled to:
You can only delete or correct [donations/purchases] where all the items are active.
If you need to delete this [donation / purchase] or make a correction, please make the following items active: <%= @distribution.inactive_items.map(&:name).join(", ") %>
(replace distribution in the above with donation or purchase as appropriate)
Criteria for completion
[ ] on view for purchases and donations, delete button is disabled if and only if there are inactive items
[ ] appropriate informational message appears if and only there are inactive items.
Summary
Disable the deletion of donations and purchases if they include an inactive item
Why?
We're going to error out on this anyway, better to be up front about it. Also, on purchases, it's currently throwing an inventory error (which will be a 500 in production)
Details
This is in the view for the donations and purchase. We already disable the "make a correction" button if there are inactive items Do the same for the delete button Change the informational message regarding why the buttons are disabled to:
You can only delete or correct [donations/purchases] where all the items are active. If you need to delete this [donation / purchase] or make a correction, please make the following items active: <%= @distribution.inactive_items.map(&:name).join(", ") %> (replace distribution in the above with donation or purchase as appropriate)
Criteria for completion