Fix issue showing item card reminder when threshold equals stock value [SCI-9828] (#6753)

This commit is contained in:
wandji 2023-12-04 16:21:08 +01:00 committed by GitHub
parent b7177a8592
commit 1d52e20f4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@ module RepositoryDatatable
!scope[:repository].is_a?(RepositorySnapshot) &&
value_object.data.present? &&
value_object.low_stock_threshold.present?
data[:reminder] = value_object.low_stock_threshold > value_object.data
data[:reminder] = value_object.low_stock_threshold >= value_object.data
if data[:reminder] && value_object.data&.positive?
data[:reminder_text] =
I18n.t('repositories.item_card.reminders.stock_low', stock_formated: value_object.formatted)