mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
fix computing reservation price
This commit is contained in:
parent
95d8f1d204
commit
920a97f40f
@ -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] >= 0
|
||||
if real_price.positive? && options[:prepaid][:minutes]&.positive?
|
||||
consumed = slot_minutes
|
||||
consumed = options[:prepaid][:minutes] if slot_minutes > options[:prepaid][:minutes]
|
||||
real_price = (slot_minutes - consumed) * (slot_rate / MINUTES_PER_HOUR)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test_helper'
|
||||
|
||||
module Prices
|
||||
class AsAdminTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
|
Loading…
x
Reference in New Issue
Block a user