Fixed threshold explanation and min qty math
Description
This changes the min qty on Asset models, Components, Accessories, Consumables and Licenses to 'Increase Alert Threshold' giving a better understanding of how this value will interact with the Settings threshold. The Helper text has been updated as well. Also the way the min_amt is calculated in the notification center has been updated to total the asset model and settting threshold values.
A Helper method was made to better handle the sum for transformers.
Type of change
Please delete options that are not relevant.
- [ x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
- [ ] Test A
- [ ] Test B
Test Configuration:
- PHP version:
- MySQL version
- Webserver version
- OS version
Checklist:
- [ ] I have read the Contributing documentation available here: https://snipe-it.readme.io/docs/contributing-overview
- [ ] I have formatted this PR according to the project guidelines: https://snipe-it.readme.io/docs/contributing-overview#pull-request-guidelines
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
PR Summary
- Adding Low Inventory Alert Threshold Feature
An enhancement has been added to the
Helper.phpfile. Now, our system will check for low inventory by comparing minimum amounts with a newly introduced alert threshold. - Dependency Addition In Controller
To facilitate this,
AssetModelsController.phpis now linked to theSettingmodel. This helps us access all application settings directly from the controller. - Enhancing Edit Method in Controller
In the same file (
AssetModelsController.php), additional 'setting' data has been attached to the 'view'. This allows more data to be sent to the webpage when someone is editing an asset model. - Updating User Interface
In the
edit.blade.phpfile, new user interface elements such as a label for the 'Increase Alert Threshold' and a corresponding input field have been introduced. Standard threshold values are now also displayed for better context. - Added Tooltip
For ease of understanding, a tooltip and information icon have been added next to the input field inside
edit.blade.php. This tooltip provides helpful hints about what the input field is for. - Translation Updates
The explanatory text associated with the minimum amount field (
min_amt_help) in thegeneral.phplanguage file has been updated for better clarity and understanding.
Wouldn't we want to apply this to all of the spots where we use minimum quantities?
@snipe changes applied to the partial blade. controllers and transformers updated as well 🙂
@snipe is this good?
any updates when this will be solved?