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:
parent
60df8d609f
commit
02870659e0
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user