snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Fixed threshold explanation and min qty math

Open Godmartinz opened this issue 2 years ago • 4 comments

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.

image Fixes #14604 [sc-25227]

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

Godmartinz avatar Apr 15 '24 17:04 Godmartinz

PR Summary

  • Adding Low Inventory Alert Threshold Feature An enhancement has been added to the Helper.php file. 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.php is now linked to the Setting model. 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.php file, 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 the general.php language file has been updated for better clarity and understanding.

what-the-diff[bot] avatar Apr 15 '24 17:04 what-the-diff[bot]

Wouldn't we want to apply this to all of the spots where we use minimum quantities?

snipe avatar Apr 18 '24 13:04 snipe

@snipe changes applied to the partial blade. controllers and transformers updated as well 🙂

Godmartinz avatar Apr 23 '24 16:04 Godmartinz

@snipe is this good?

Godmartinz avatar May 13 '24 17:05 Godmartinz

any updates when this will be solved?

zlyczarny avatar Jul 15 '24 10:07 zlyczarny