Skip to content

A free open source IT asset/license management system

Switched <= to < for min qty remaining remaining alerts

snipe5f28292cac7a
diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php
index 12ca624cfd..d96d72721e 100644
--- a/app/Helpers/Helper.php
+++ b/app/Helpers/Helper.php
@@ -850,7 +850,7 @@ class Helper
foreach ($consumables as $consumable) {
$avail = $consumable->numRemaining();
- if ($avail <= ($consumable->min_amt) + $alert_threshold) {
+ if ($avail < ($consumable->min_amt) + $alert_threshold) {
if ($consumable->qty > 0) {
$percent = number_format((($avail / $consumable->qty) * 100), 0);
} else {
@@ -869,7 +869,7 @@ class Helper
foreach ($accessories as $accessory) {
$avail = $accessory->qty - $accessory->checkouts_count;
- if ($avail <= ($accessory->min_amt) + $alert_threshold) {
+ if ($avail < ($accessory->min_amt) + $alert_threshold) {
if ($accessory->qty > 0) {
$percent = number_format((($avail / $accessory->qty) * 100), 0);
} else {
@@ -888,7 +888,7 @@ class Helper
foreach ($components as $component) {
$avail = $component->numRemaining();
- if ($avail <= ($component->min_amt) + $alert_threshold) {
+ if ($avail < ($component->min_amt) + $alert_threshold) {
if ($component->qty > 0) {
$percent = number_format((($avail / $component->qty) * 100), 0);
} else {
@@ -911,7 +911,7 @@ class Helper
$total_owned = $asset_model->assets_count; // requires the withCount() clause in the initial query!
$avail = $asset_model->available_assets_count; // requires the withCount() clause in the initial query!
- if ($avail <= ($asset_model->min_amt) + $alert_threshold) {
+ if ($avail < ($asset_model->min_amt) + $alert_threshold) {
if ($avail > 0) {
$percent = number_format((($avail / $total_owned) * 100), 0);
} else {
@@ -929,7 +929,7 @@ class Helper
foreach ($licenses as $license) {
$avail = $license->remaincount();
- if ($avail <= ($license->min_amt) + $alert_threshold) {
+ if ($avail < ($license->min_amt) + $alert_threshold) {
if ($avail > 0) {
$percent = number_format((($avail / $license->min_amt) * 100), 0);
} else {
diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php
index da59bb6390..f418af4088 100644
--- a/resources/views/partials/bootstrap-table.blade.php
+++ b/resources/views/partials/bootstrap-table.blade.php
@@ -2542,8 +2542,8 @@
function minAmtFormatter(row, value) {
if ((row) && (row!=undefined)) {
-
- if (value.remaining <= value.min_amt) {
+
+ if (value.remaining < value.min_amt) {
return '<span class="text-danger text-bold" data-tooltip="true" title="{{ trans('admin/licenses/general.below_threshold_short') }}"><x-icon type="warning" class="text-yellow" /> ' + value.min_amt + '</span>';
}
return value.min_amt