1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-03-22 13:19:50 +01:00

[bug] prepaid hours not used if bought slot is longer than remaining prepaid time

This commit is contained in:
Sylvain 2021-07-02 12:39:34 +02:00
parent 60df8d609f
commit 02870659e0
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
# Changelog Fab-manager
- Fix a bug: missing hour format for norwegian
- Fix a bug: prepaid hours not used if bought slot is longer than remaining prepaid time
## v5.1.2 2021 July 2

View File

@ -86,7 +86,7 @@ class CartItem::Reservation < CartItem::BaseItem
slot_rate
end
# subtract free minutes from prepaid packs
if real_price.positive? && options[:prepaid][:minutes] >= slot_minutes
if real_price.positive? && options[:prepaid][:minutes] >= 0
consumed = slot_minutes
consumed = options[:prepaid][:minutes] if slot_minutes > options[:prepaid][:minutes]
real_price = (slot_minutes - consumed) * (slot_rate / MINUTES_PER_HOUR)